Skip to content

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

@gsebastianlopezillia

Description

@gsebastianlopezillia

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions