android – C2D_ Permission name C2D in message_ Message is not unique

I received 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 list:

<permission
    android:name="my.packagename.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />
<uses-permission android:name="my.packagename.permission.C2D_MESSAGE" />

After adding applicationidsuffix to a flavor in build. Gradle, problems began to appear (at first glance, it seemed irrelevant)

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 have created a copy of Google - services. JSON

I have added google-services.json to:

 app\src\acceptance\google-services.json (fake numbers)

 app\src\production\google-services.json

I have made different false values for the accepted keys. I don't want Google Analytics to be used in the acceptance version. So I prefer not to create a separate google-services.json. Is this possible?

The license in the simply removing manifest does not apply to API < 23

resolvent:

It looks like you are using the latest firebase cloud messaging (FCM) SDK, but the old GCM permissions are retained. The FCM SDK will automatically inject the necessary permissions into the list during construction

Remove C2D from the list according to the migration guide_ Message permissions: https://developers.google.com/cloud-messaging/android/android-migrate-fcm

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>