【问题标题】:INSTALL_FAILED_DUPLICATE_PERMISSION when try to install the app尝试安装应用程序时的 INSTALL_FAILED_DUPLICATE_PERMISSION
【发布时间】:2021-05-31 14:07:07
【问题描述】:
我写了一个应用程序。一切都很好,但后来我想在家里的电脑上处理它。问题是当我想在模拟器中启动应用程序时收到错误消息“INSTALL_FAILED_DUPLICATE_PERMISSION”。在工作中,我对模拟器使用相同的设置。当我尝试在 2 台不同的计算机上使用它时,其他应用程序也没有出现问题。
对不起,如果我没有给你足够的信息,但我是编程新手。
也许有人有类似的经历,可以帮助我。
提前致谢!
【问题讨论】:
标签:
java
android
android-studio
installation
android-emulator
【解决方案2】:
您可以在 AndroidManifest.xml 文件中的 packageName 位置使用 ${applicationId}。
替换
<permission
android:name="com.example.testapp.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.testapp.permission.C2D_MESSAGE"/>
到
<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
在接收者的intent-filter 中:
替换
<category android:name="com.example.testapp"/>
到
<category android:name="${applicationId}"/>
DUPLICATE_PERMISSION 问题将得到解决。