INSTALL_FAILED_DUPLICATE_PERMISSION…C2D_MESSAGE

我在应用中使用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指南,代码,因此它必须是罚款。


一只萌萌小番薯
浏览 1304回答 3
3回答

郎朗坤

去掉<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/><permission&nbsp; &nbsp; android:name="${applicationId}.permission.C2D_MESSAGE"&nbsp; &nbsp; android:protectionLevel="signature"/>运行应用程序...然后再次添加许可并运行应用程序。准备!。
打开App,查看更多内容
随时随地看视频慕课网APP