android 5.0 lollipop app install shows Unknown error code during application install: "-505"
Asked Answered
U

8

17

While downloading an app, an error dialog with this text shows up: Unknown error code during application install: "-505"

Ullage answered 21/10, 2014 at 16:7 Comment(1)
If you are using a library project that bundles Google Maps and your users are reporting the -505 error, see this answer for a possible solution: https://mcmap.net/q/688584/-android-5-0-lollipop-app-install-shows-unknown-error-code-during-application-install-quot-505-quotHinze
T
29

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.

Tenuto answered 14/11, 2014 at 17:5 Comment(5)
Thank you! This fixed the issue for me. Definitely seems like an issue with multiple accounts.Uitlander
i also faced same issue. and resoled it. they should show proper message i guess.Banuelos
have this issue on 5.0.1 without multiple accounts :(Detergency
@Detergency are you using Google Maps inside a library project? I've discovered a fix if you are: https://mcmap.net/q/688584/-android-5-0-lollipop-app-install-shows-unknown-error-code-during-application-install-quot-505-quotHinze
@Hinze thanks but no, it was an issue with the cordova framework I was using, and having various versions of the app installed (even on different namespaces)Detergency
A
6

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}"/>
Alderete answered 10/4, 2015 at 14:19 Comment(3)
Great solution. I would have missed changing the category as well if you didn't point that out. Thanks a lot!Thermosiphon
I'm glad it was useful to you, @Stephen!Alderete
great solution, didn't know we can use ${packageName} inside manifestReiche
H
6

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:

enter image description here

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

Hinze answered 24/9, 2015 at 20:51 Comment(0)
S
4

try to uninstall the app with adb:

adb uninstall com.yourpackage
Sailer answered 26/11, 2014 at 20:47 Comment(0)
L
3

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)..

Lemmy answered 21/11, 2014 at 10:41 Comment(0)
D
1

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.
Dispart answered 2/9, 2015 at 11:5 Comment(0)
U
0

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.

Ullage answered 21/10, 2014 at 16:12 Comment(0)
F
0

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.

Forsake answered 4/3, 2015 at 20:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.