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.