Skip to content

Fix SurveyMonkey Android SDK manifest #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kahakai
Copy link

@kahakai kahakai commented Oct 10, 2022

Hello! According to the Google Play's target API level requirement,

Starting in November 2022, app updates must target API level 31 or above and adjust for behavioral changes in Android 12.

Looking at the section Migrate from Android 11 (API level 30) to Android 12 (API level 31), there is a point about Intent filters.

Intent filters: If your app contains activities, services, or broadcast receivers that use intent filters, you must explicitly declare the android:exported attribute for these components.

I did explicitly declare the android:exported attribute for all the components of the app beforehand as it has been a best-practice for Android development and even recommended by Google in the documentation for long time.

If you set the targetSdkVersion to 31 then builds fail because of react-native-survey-monkey. You will see a generic message Manifest merger failed with multiple errors, see logs.
image
Running Gradle with the --info flag helps as it logs the task and manifest merger steps.
image
Here you go, the last one before a fail is com.surveymonkey:surveymonkey-android-sdk:2.0.0, specifically com.surveymonkey.surveymonkeyandroidsdk.SMFeedbackActivity.

The problem with the abandoned SurveyMonkey Mobile SDK is that the android:exported attribute is not declared in the manifest and probably never will, thus we have to add it by ourselves. We don't have the source code of the SDK because it is distributed as an AAR (Android library), look at the surveymonkey-android-sdk repository.

Luckily, we have an ability to manage Manifest files with build tools. All the manifest files are combined into one file. We can tweak the SurveyMonkey Android SDK manifest with the merge node marker to add the required android:exported attribute.

TLDR: I added the now required android:exported attribute to the SurveyMonkey Android SDK manifest.

Add android:exported attribute to
the SurveyMonkey Android SDK manifest.
mikemonaco added a commit to mikemonaco/react-native-survey-monkey that referenced this pull request Oct 27, 2022
…o locate it otherwise. Also includes Android API level 31 fixes from yarikpwnzer#33
@mikemonaco
Copy link

mikemonaco commented Oct 28, 2022

Thanks for this fix, helped us out! I also was having problems with

implementation 'com.surveymonkey:surveymonkey-android-sdk:2.0.0'

I was getting the following error

Could not find com.surveymonkey:surveymonkey-android-sdk:2.0.0

I ended up making my own fork which bundles the aar file directly as well as implementing your fix: mikemonaco@8999ec7

@rangerscience
Copy link

It looks like maybe @yarikpwnzer is no longer active on Github, but @rMozes is. What's needed to get this merged? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants