Android L Permission Conflict Between Release And Debug Apks
I've upgraded to Android L and have both a released version of my app in 'Google play' and a debug version which we use for development. They are signed with different keys. My pro
Solution 1:
I can successfully have both debug
and release
editions of a GCM client app installed on the same Android 5.0 Nexus 9 at the same time, by amending the manifest to use placeholders:
<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission
android:name="${applicationId}.permission.C2D_MESSAGE" />
Note that you should also use ${applicationId}
in your <receiver>
for the <category>
:
<receiverandroid:name="GCMBroadcastReceiverCompat"android:permission="com.google.android.c2dm.permission.SEND"><intent-filter><actionandroid:name="com.google.android.c2dm.intent.RECEIVE"/><categoryandroid:name="${applicationId}" /></intent-filter></receiver>
(frankly, I am unconvinced that the custom <permission>
is even needed anymore, given that I tried removing it and can still receive GCM messages)
If you then define your build.gradle
as you have it, with an applicationIdSuffix
for one of the build types (e.g., debug
), you will wind up with separate custom permissions by build type, and you will be able to have them installed side by side.
Post a Comment for "Android L Permission Conflict Between Release And Debug Apks"