While downloading an app, an error dialog with this text shows up: Unknown error code during application install: "-505"
I've found the issue with "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.
Had this issue too. I was releasing Sandbox and Production apps with different package names, but same GCM permissions.
I started using ${packageName}
in AndroidManifest.xml file.
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-filter from:
<category android:name="com.playgong"/>
to:
<category android:name="${packageName}"/>
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.
Fix:
make sure that defaultConfig.applicationId is defined in android section of the build.gradle
file for each project using your library
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.
2.) You will see this error message when you try to install a second app that uses your library via Android Studio:
3.) In your console, you will see a message like this:
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
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
try to uninstall the app with adb:
adb uninstall com.yourpackage
I think the answer is already been conveyed by @Brigadier and @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.
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)..
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-
- 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.
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.
Failure [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.
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.
© 2022 - 2024 — McMap. All rights reserved.