Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different flavors with GCM

I have two flavors of my app, one debug and one release. The reason why these are different flavors is that I want to allow others to download the debug version to test out new features. So it should be possible to have both apps installed at once.

My app uses GCM which has created some problems with the new security features in Android Lollipop.

This is what I get when I have one flavor install, and try to install the other flavor:

Failure [INSTALL_FAILED_DUPLICATE_PERMISSION perm=com.example.test.permission.C2D_MESSAGE pkg=com.example.test]

I have tried to change the permission in the debug flavor by adding this to its Android Manifest:

<permission
    android:name="com.example.test.debug.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />
<uses-permission android:name="com.example.test.debug.permission.C2D_MESSAGE" />

But I still get the same error. Anyone know how to solve this?

like image 824
Heinrisch Avatar asked Oct 27 '14 14:10

Heinrisch


1 Answers

In the link provided by Sunil Mishra it is said that it will work when they are signed by the same key. In my case they were not since one was signed with the release key and the other with the debug key. When releasing my apps for testing they will be signed by the same key.

Thanks Sunil!

like image 182
Heinrisch Avatar answered Oct 20 '22 05:10

Heinrisch