android 5.0 棒棒糖应用程序安装在应用程序安装期间显示未知错误代码:“-505”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26491251/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
android 5.0 lollipop app install shows Unknown error code during application install: "-505"
提问by andude
While downloading an app, an error dialog with this text shows up: Unknown error code during application install: "-505"
下载应用程序时,会出现一个带有此文本的错误对话框:应用程序安装过程中出现未知错误代码:“-505”
回答by Brigadier
I've found the issue with "INSTALL_FAILED_DUPLICATE_PERMISSION".
我发现了“INSTALL_FAILED_DUPLICATE_PERMISSION”的问题。
If you have Android 5.0 and multi user enabled, check if you have the app that is causing problems in your "Guest" account and uninstall it. Then go back to your main user and try installing the app again. It worked for me! Hope Google fix this with multiple accounts.
如果您启用了 Android 5.0 和多用户,请检查您的“访客”帐户中是否有导致问题的应用程序并将其卸载。然后返回到您的主要用户并尝试再次安装该应用程序。它对我有用!希望谷歌用多个帐户解决这个问题。
回答by ViliusK
Had this issue too. I was releasing Sandboxand Productionapps with different package names, but same GCM permissions.
也有这个问题。我发布的Sandbox和Production应用程序包名称不同,但 GCM 权限相同。
I started using ${packageName}
in AndroidManifest.xmlfile.
我开始${packageName}
在AndroidManifest.xml文件中使用。
I changed from
我从
<!-- GCM specific permissions -->
<permission
android:name="com.playgong.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.playgong.permission.C2D_MESSAGE"/>
to
到
<!-- GCM specific permissions -->
<permission
android:name="${packageName}.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
<uses-permission android:name="${packageName}.permission.C2D_MESSAGE"/>
And in receiver's intent-filterfrom:
在接收者的意图过滤器中:
<category android:name="com.playgong"/>
to:
到:
<category android:name="${packageName}"/>
回答by DiscDev
In my case, this was happening because I publish 2 apps that are based on the same library (free vs. paid version) that is using Google Play Services / Google Maps. Google Maps is using a content provider that requires apps using your library to be configured properly for it to work inside a library.
就我而言,发生这种情况是因为我发布了 2 个基于使用 Google Play 服务/Google 地图的相同库(免费与付费版本)的应用程序。Google 地图使用的内容提供程序要求正确配置使用您的图书馆的应用程序,以便在图书馆内工作。
Fix:make sure that defaultConfig.applicationId is defined in android section of the build.gradle
file for each project using your library
修复:确保在build.gradle
使用您的库的每个项目的文件的android 部分中定义了 defaultConfig.applicationId
android {
defaultConfig.applicationId = "com.company.appname"
}
I would recommend using the package name of the specific app. With this fix, the provider names will no longer conflict, and your app will run as expected.
我建议使用特定应用程序的包名称。使用此修复程序,提供程序名称将不再冲突,您的应用程序将按预期运行。
Symptoms
症状
1.) Your users are seeing the dreaded "-505" install error when installing your app from the Play Store.
1.) 从 Play 商店安装您的应用程序时,您的用户会看到可怕的“-505”安装错误。
2.) You will see this error message when you try to install a second app that uses your library via Android Studio:
2.) 当您尝试通过 Android Studio 安装使用您的库的第二个应用程序时,您将看到此错误消息:
3.) In your console, you will see a message like this:
3.) 在您的控制台中,您将看到如下消息:
Package couldn't be installed in /data/app/com.company.appname-1
com.android.server.pm.PackageManagerException:
Can't install because provider name
com.google.android.gms.measurement.google_measurement_service
(in package com.company.appname) is already used by
com.company.otherInstalledAppName
The fix is to make sure that defaultConfig.applicationId is defined in android section of the build.gradle
file for each project using your library
修复是确保 defaultConfig.applicationId 在build.gradle
文件的android 部分为每个使用您的库的项目定义
android {
defaultConfig.applicationId = "com.company.appname"
}
More reading can be found here in the original bug report: Issue 784: Multiple apps using same authority provider name
更多阅读可以在原始错误报告中找到:问题 784:多个应用程序使用相同的权限提供程序名称
回答by Giuseppe
try to uninstall the app with adb:
尝试使用 adb 卸载应用程序:
adb uninstall com.yourpackage
回答by humblerookie
I think the answer is already been conveyed by @Brigadier and @andude.
我认为@Brigadier 和@andude 已经传达了答案。
And this seems to have started with the Lollipop upgrade. Here's the root cause of the same and you could cross check it in Logcat while installing.
而这似乎是从 Lollipop 升级开始的。这是相同的根本原因,您可以在安装时在 Logcat 中交叉检查它。
You primarily have 2 apps on your device which have a common signed permission.i.e If you've been developing using google maps or any other module which requires a custom signature(< Package-name >.MAPS_RECEIVE or likewise) then most certainly you have two apps that have the same signed permission(i.e the package name in these permissions are the same)..
您的设备上主要有 2 个具有共同签名权限的应用程序。即如果您一直在使用谷歌地图或任何其他需要自定义签名的模块(< Package-name >.MAPS_RECEIVE 或类似)进行开发,那么您肯定有两个具有相同签名权限的应用程序(即这些中的包名称)权限相同)。
回答by Mridul Shrivastava
This is the issue because the app still exists in your apps list after uninstall, this issue comes on Android 5.0 or later(Lollipop) . For resolving this problem you should do followings-
这是问题,因为卸载后该应用程序仍然存在于您的应用程序列表中,此问题出现在 Android 5.0 或更高版本(Lollipop)上。要解决此问题,您应该执行以下操作-
- Go to device settings and select apps
- In this list you will get your app with "NOT INSTALLED" Tag
- Open the app and select menu button
- Tap on optionMenu and Select "Uninstall for all Users" After doing above, the problem would resolve.
- 转到设备设置并选择应用程序
- 在此列表中,您将获得带有“未安装”标签的应用
- 打开应用程序并选择菜单按钮
- 点击optionMenu并选择“为所有用户卸载”完成上述操作后,问题将解决。
回答by Mak
Multiple users installing same app on same device may cause this error. Please remove other app from the device and that should work.
多个用户在同一设备上安装相同的应用程序可能会导致此错误。请从设备中删除其他应用程序,它应该可以工作。
I faced similar issue, however in my case it was an old development build sitting on my device and when I was trying to install from play store this error was coming.
我遇到了类似的问题,但是在我的情况下,这是一个旧的开发版本,位于我的设备上,当我尝试从 Play 商店安装时,此错误即将到来。
回答by andude
This error means there is a duplicate permission in Android Manifest. Not within just one app but the other app has it as well. For example when installing app with adb install, it shows what this -505 error means. So, first app will install fine, but when you install second app, this error is seen.
此错误表示 Android Manifest 中存在重复权限。不仅在一个应用程序中,另一个应用程序也有它。例如,使用 adb install 安装应用程序时,它会显示此 -505 错误的含义。因此,第一个应用程序可以正常安装,但是当您安装第二个应用程序时,会看到此错误。
Failure [INSTALL_FAILED_DUPLICATE_PERMISSION perm=com.example.permission.XYZ pkg=com.example]
失败 [INSTALL_FAILED_DUPLICATE_PERMISSION perm=com.example.permission.XYZ pkg=com.example]
So be sure not to have two apps in appstore with same perm package name.
所以一定不要在 appstore 里有两个 app 有相同的 perm 包名。