INSTALL_FAILED_DUPLICATE_PERMISSION... C2D_MESSAGE [英] INSTALL_FAILED_DUPLICATE_PERMISSION... C2D_MESSAGE
问题描述
我在我的应用中使用了 Google 通知,到目前为止我已经在清单中完成了以下操作:
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 -->
在我将 Nexus 7 更新到 Android 5.0 之前,它运行良好.
现在,当我尝试使用 Eclipse 在此设备中安装该应用程序时,出现此错误:
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
INSTALL_FAILED_DUPLICATE_PERMISSION perm=com.myapp.permission.C2D_MESSAGE pkg=com.myapp
我不明白有什么问题?它在 Android 5.0 之前一直运行良好.
我知道我在两行中使用 C2D_MESSAGE
,permission
和 uses-permission
但我已经从原始 Google GCM 指南中复制了该代码,所以应该没问题.
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.
推荐答案
我找到了适合我的解决方案.
I've found a solution that works for me.
在我的设备中 (Nexus 7) Android 5.0.Lollipop 我按照以下步骤操作.
In My Device (Nexus 7) Android 5.0. Lollipop I follow these steps.
卸载应用程序后,您将在 Downloaded
选项卡的应用程序列表下找到 App Name
.
After Uninstalling App You will find App Name
under Apps List of the Downloaded
tab.
- 进入设置
- 应用程序
- 在列表底部,您会找到带有未安装"标签的
YourApp
- 打开
- 点击
OptionMenu
并选择为所有用户卸载"
完成这些步骤后,我成功安装了新应用并且运行良好.
After these steps, I successfully install the new app and it's running well.
这篇关于INSTALL_FAILED_DUPLICATE_PERMISSION... C2D_MESSAGE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!