I am using Google notifications in my app, and until now I have done below in the manifest:
<!-- GCM -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> <!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.WAKE_LOCK" /> <!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <!-- This app has permission to register and receive data message. -->
<!-- Creates a custom permission so only this app can receive its messages. NOTE: APP_PACKAGE.permission.C2D_MESSAGE -->
<permission android:name="com.myapp.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.myapp.permission.C2D_MESSAGE" />
<!-- END GCM -->
It worked perfectly until I updated my Nexus 7 to Android 5.0.
Now when I try to install the app in this device with Eclipse, I get this error:
INSTALL_FAILED_DUPLICATE_PERMISSION perm=com.myapp.permission.C2D_MESSAGE pkg=com.myapp
I don’t understand what is wrong? It was working perfectly until Android 5.0.
I know that I am using C2D_MESSAGE
in two lines, permission
and uses-permission
but I have copied that code from the original Google GCM guide, so it must be fine.