danwilson / google-analytics-plugin

Cordova (PhoneGap) Plugin to connect to the native Google's Universal Analytics SDK 3.0
MIT License
693 stars 500 forks source link

Plugging getting error for Android 12 due to :capacitor-cordova-android-plugins:processReleaseManifest execution failed #614

Open raulnsuarez opened 1 year ago

raulnsuarez commented 1 year ago

Hello, I'm working on Ionic Framework using Capacitor. When I try to perform the assembleRelease the build process gets stopped by a failure in the :capacitor-cordova-android-plugins:processReleaseManifest task:

Task :capacitor-cordova-android-plugins:processReleaseManifest FAILED C:\Users\rsuarez\source\repos\Incentive\android\capacitor-cordova-android-plugins\src\main\AndroidManifest.xml:6:1-10:12 Error: android:exported needs to be explicitly specified for element <receiver#com.google.android.gms.analytics.AnalyticsReceiver>. 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 failed with an exception.

hamza-mubeen-07 commented 1 year ago

I am also facing the same error while trying to create APK. I tried your solution but it did not work for me at all.

raulnsuarez commented 1 year ago

If manipulate the plugin.xml doesn't work for you, you can manually update the AndroidManifest.xml file in android\capacitor-cordova-android-plugins\src\main and define android:exported=false in the receiver key, at least this works for me. Here it's what its looks like for me:

image

I am also facing the same error while trying to create APK. I tried your solution but it did not work for me at all.

hamza-mubeen-07 commented 1 year ago

Thanks this worked for me.

addahlbe commented 1 year ago

It looks like someone updated this 6 months ago, but there has not been a package update since the change was made. Can you please publish the project with a new version?