Skip to content
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

Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. #342

Open
gsebastianlopezillia opened this issue Aug 24, 2022 · 0 comments

Comments

@gsebastianlopezillia
Copy link

Building an app with voltbuilder targeting API 31, using android-cordova 11 I get this error:

FAILURE: Build failed with an exception.

  • What went wrong:
    _Execution failed for task ':app:processDebugMainManifest'.

Manifest merger failed : android:exported needs to be explicitly specified for element <receiver#nl.xservices.plugins.ShareChooserPendingIntent>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details._

FYI, the Android Developer site says:

This element sets whether the activity can be launched by components of other applications:
If "true", the activity is accessible to any app, and is launchable by its exact class name.
If "false", the activity can be launched only by components of the same application, applications with the same user ID, or privileged system components. This is the default value when there are no intent filters.

I manage to fix this on my local, but voltbuild as other tools generate the bundles "some where up there" using the npm packages so if the fix isn't applied to this project all the builds targeting android 12 and higher using this plugin are going to fail. This error can be fixed by adding the property "android:exported" on the ln 66 on plugin.xml replacing:

<config-file target="AndroidManifest.xml" parent="/manifest/application/activity">
by
<config-file target="AndroidManifest.xml" android:exported="true" parent="/manifest/application/activity">

I can't promise that I would do a PR with this case so if someone can do it, thanks in advance.

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

No branches or pull requests

1 participant