我在应用中使用Google通知,到目前为止,我在清单中做了以下操作:
<!-- 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 -->
在我将Nexus 7更新为Android 5.0之前,它一直运行良好。
现在,当我尝试使用Eclipse在此设备中安装应用程序时,出现以下错误:
INSTALL_FAILED_DUPLICATE_PERMISSION perm = com.myapp.permission.C2D_MESSAGE pkg = com.myapp
我不明白怎么了?在Android 5.0之前,它一直运行良好。
我知道,我使用C2D_MESSAGE
的两条线,permission
并uses-permission
但我已经复制从原来的谷歌GCM指南,代码,因此它必须是罚款。