Home > Net >  Ionic cordova, android:exported needs to be explicitly specified for element <activity#com.gae.sc
Ionic cordova, android:exported needs to be explicitly specified for element <activity#com.gae.sc

Time:12-12

I am updating my android-targetSdkVersion to 32. I have done a few changes on my project for this update, but there is an error for which I can't find any solution.

When I try to build my project by:

ionic cordova build android

My project responds:

FCMPlugin: Support for Gradle v4 or lower is deprecated. Please upgrade to a newer version. Task :app:mergeDebugResources FAILED

Task :app:processDebugMainManifest FAILED {project}/platforms/android/app/src/main/AndroidManifest.xml:64:9-69:20 Error: android:exported needs to be explicitly specified for element <activity#com.gae.scaffolder.plugin.FCMPluginActivity>. 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. {project}/platforms/android/app/src/main/AndroidManifest.xml:40:9-44:19 Error: android:exported needs to be explicitly specified for element <service#com.gae.scaffolder.plugin.MyFirebaseMessagingService>. 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. {project}/platforms/android/app/src/main/AndroidManifest.xml:52:9-56:20 Error: 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.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeDebugResources'. A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable Resource compilation failed (Failed to compile resource file: {project}/platforms/android/app/src/main/res/xml/config.xml: . Cause: com.ctc.wstx.exc.WstxParsingException: Undeclared namespace prefix "android" (for attribute "exported") at [row,col {unknown-source}]: [99,44]). Check logs for more details.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

2: Task failed with an exception.

  • What went wrong: Execution failed for task ':app:processDebugMainManifest'. Manifest merger failed with multiple errors, see logs

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ==============================================================================

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 34s 16 actionable tasks: 2 executed, 14 up-to-date Command failed with exit code 1: {project}/platforms/android/gradlew cdvBuildDebug -b {project}/platforms/android/build.gradle Waiting for the debugger to disconnect...

If have tried going to my /plugins folder, search the plugin and add it into it's plugin.xml

android:exported="true"

But still, it's not generating the 'android:exported="true"' into my AndroidManifest.xml...

Has anybody had this problem before? Thank you in advance for your help.

CodePudding user response:

did you add 'android:exported="true"' to the activity and service tags in plugin.xml? If you have already added this in both tags then try to remove and add the android platform.

  • Related