I'm getting this error:
Permission name C2D_MESSAGE is not unique (appears in both my.packagename.permission.C2D_MESSAGE and my.packagename.acc.permission.C2D_MESSAGE) (Previous permission here)
In my Android manifest:
<permission
android:name="my.packagename.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="my.packagename.permission.C2D_MESSAGE" />
The problem started after adding the applicationIdSuffix to a flavor in build.gradle (which at first glance seemed to have nothing to do with it).
Build.gradle:
flavorDimensions "type"
productFlavors {
acceptance {
dimension="type"
applicationIdSuffix ".acc"
versionNameSuffix "-acc"
}
production {
dimension="type"
applicationIdSuffix ""
versionNameSuffix ""
}
}
Application.java:
if (BuildConfig.DEBUG) {
GoogleAnalytics.getInstance(context).setDryRun(true);
} else {
setupGoogleAnalytics();
}
I've created a copy of google-services.json.
I've added google-services.json to:
app\src\acceptance\google-services.json (fake numbers)
app\src\production\google-services.json
I've made different bogus values for the keys in the acceptance. I don't want Google Analytics in the acceptance version. So I prefer to not create a separate google-services.json. Is this possible?
Simply removing the permission in manifest doesn't work for API<23.
This looks like you're using the latest Firebase Cloud Messaging (FCM) SDK but retaining the old GCM permissions. The FCM SDK automatically injects the necessary permissions into your manifest at build time.
Remove the C2D_MESSAGE permission from your manifest per the migration guide here: https://developers.google.com/cloud-messaging/android/android-migrate-fcm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With