我在應(yīng)用中使用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之前,它一直運(yùn)行良好?,F(xiàn)在,當(dāng)我嘗試使用Eclipse在此設(shè)備中安裝應(yīng)用程序時(shí),出現(xiàn)以下錯(cuò)誤:INSTALL_FAILED_DUPLICATE_PERMISSION perm = com.myapp.permission.C2D_MESSAGE pkg = com.myapp我不明白這是怎么回事...直到Android 5.0,它都可以正常工作。我知道,我使用C2D_MESSAGE的兩條線(xiàn),permission并uses-permission但我已經(jīng)復(fù)制從原來(lái)的谷歌GCM指南,代碼,因此它必須是罰款。
3 回答

郎朗坤
TA貢獻(xiàn)1921條經(jīng)驗(yàn) 獲得超9個(gè)贊
去掉
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
運(yùn)行應(yīng)用程序...然后再次添加許可并運(yùn)行應(yīng)用程序。
準(zhǔn)備!。
- 3 回答
- 0 關(guān)注
- 1432 瀏覽
添加回答
舉報(bào)
0/150
提交
取消