Unknown error code during application install "-505"
Asked Answered
U

8

14

I have checked this android 5.0 lollipop app install shows Unknown error code during application install: "-505". But it doesn't seem to address my case as I dont use multiuser env.

I have an app in the playstore which worked fine on my nexus 4(4.4.x) till i upgraded to lollipop and it showed this error every time i tried to install it from playstore(It installs fine if I run it via adb).

Can't understand why I might be facing this issue, neither is there any other reference to this error code. Any help is appreciated.

Unstrained answered 19/11, 2014 at 6:39 Comment(0)
U
19

This seems stupid on my part, yet finally found the answer which seems to be the fact that I had another dev app(diff package name) which had a common signed permission with the playstore app. Buried deep in my logcat was this.

11-21 16:20:02.855: E/Finsky(8986): [1] PackageInstallerImpl.handleCommitCallback: Error -505
while installing <package>: INSTALL_FAILED_DUPLICATE_PERMISSION: Package <package> attempting to
redeclare permission <package>.permission.MAPS_RECEIVE already owned by 

beginning with lollipop it seems this isn't permitted. Thanks to everyone.

EDIT

The solution if not apparent yet is to change the permission from

 <permission android:name="<old package>.permission.MAPS_RECEIVE"
 android:protectionLevel="signature" />

to

<permission android:name="<new package>.permission.MAPS_RECEIVE" 
android:protectionLevel="signature" />

or whichever signed permission that is causing the same.

Unstrained answered 21/11, 2014 at 10:54 Comment(10)
Hi Humblerookie, How did you get this in your log cat. Coz i tried to install my two applications which were giving me this error on a lollipop from adb , it just installed without this error but when i tried it from google play it did.Postdate
I examined the device's logcat while the installation happened from google play. Not sure why you wouldnt be able to see the trace for the same.Anyways beginning lollipop there are other reasons responsible for this error like a certificate parsing bug as highlighted rightly by @jj1138Unstrained
Thnx, found the error. Some custom permissions with the same package structure was creating problem.Postdate
Hi @Unstrained can you please give me solution how can i resolve it . should i change the package name or any thing elseEngineering
Incase the error is arising due to a duplicate permission the you need to rename the permission to reflect your current package specific permission i.e for the scenario above it would be <new-package>.permission.MAPS_RECIEVEUnstrained
<permission android:name="com.example.gcm.permission.C2D_MESSAGE" android:protectionLevel="signature" /> can this permission cause the errorEngineering
yes if you have another app that contains the same permission, rename this to <yourapppackage>.permission.C2D_MESSAGEUnstrained
Thank you so much :) +1 I think you should append this conversation to your answer in order to improve this answerEngineering
@Engineering I have same problem with C2D_MESSAGE permission. There are two permissions tags 1) <permission ...C2D_MESSAGE> and 2) <uses-permission ..C2D_MESSAGE> . So do I have to replace com.example.gcm with my_package_name in both tags? Please reply soon. Thanks.Markusmarl
yes you have change the two of them . You can up vote my any answer for reward :)Engineering
P
7

With an official Lollipop version and for mac users (i'm sure it's analogue to windows users):

  • Go to the terminal,
  • cd into: ADT/sdk/platform-tools
  • type ./adb uninstall the.app.package

and thats it!

  • you just uninstalled the app
  • don't add the -k flag - ('-k' means keep the data and cache directories)

good luck!

Papillose answered 20/11, 2014 at 9:21 Comment(4)
This doesn't solve my problem much less even fall under the domain of my question.Ive completely uninstalled the app since i didn't choose to back my data, besides as I clearly mentioned the problem is with the playstore install and not my adb installUnstrained
I had your problem when I tried to install the app I'm developing from the playstore (so plz remove the down vote...), even after uninstalling it from my device. after I deleted all residue from my eclipse sourced version with what I have done above, the install went fine.Papillose
This is definitely the correct solution to the issue, I've downloaded the app from Google Play after uninstalling it, and got this error. This solution definitely worked for me. Thanks!!!!11Corespondent
@Papillose :This solution would have worked for the scenario I had provided a link for but it seems Its something more specific.@Corespondent It isn't the solution.Unstrained
T
4

This is caused by a bug with app certificate parsing in Lollipop:

https://code.google.com/p/android/issues/detail?id=79089

Ternopol answered 20/11, 2014 at 14:7 Comment(2)
I've cross validated the hashes and they seem to be the same,The original issue is code.google.com/p/android/issues/detail?id=79375.But a upvote seems legit for the right direction :)Unstrained
found the root cause which wasn't evident earlier and was buried in my logcat, seemed surprisingly simple.Unstrained
M
3

If the app you are trying to install has the same certificate as a similar app or related app with the SAME certificate, then Android 5.0 won't allow the installation, believing you are installing a duplicate of the already installed (but different) app. Only solution that worked for me? Uninstall the app with the same certificate, which would be an app made by same developer that made the app you are trying to install. Once you've uninstalled that app, install the problematic app, then go back and reinstall the other app which was already installed. This problem happened to me only once, when trying to install the FB Messenger app. I finally was able to install it after I uninstalled the Facebook app. Then I reinstalled Facebook after Messenger was installed. OK, good luck to all and hope this helps some of you.

Mold answered 29/11, 2014 at 16:13 Comment(0)
C
1

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.

Callable answered 4/3, 2015 at 20:51 Comment(0)
D
0

I have got similar problem and solved with this solution.

Solution: After you update your Android device to Android 5.0 Lollipop from an older version using Over-the-air update or sideloading factory image, do a factory reset. It has been found out that if you do a factory reset immediately after updating your Android version, the error does not occur, but if you don’t the error persists. Don’t forget to clear the cache too, going to Menu > Settings > Apps > Google Play Store > Clear Cache. Clear the data too, from the very same option.

Source: http://appslova.com/android-fix-unknown-error-code-application-install-505-error-505/

Hope this help!!

Dye answered 21/11, 2014 at 7:10 Comment(0)
H
0

Try resetting the play store app. You won't lose your apps following these steps. Nothing important will be lost.

Steps to follow on a motorola xoom

Go to the app drawer (menu) Tap settings Tap applications Tap the "All" tab Scroll through and look for play store Tap Play Store (not play store services!) Tap "clear data" You will then get a warning, click "ok" That's it, go through your problem again and see if it fixed. Bear in mind you will have to re-accept the terms and conditions for the play store app, when this comes up, simply click "accept"

History answered 8/8, 2015 at 0:25 Comment(0)
T
0

try adding applicationId to the defaultConfig section of gradle file like

defaultConfig {
    applicationId "com.example.www"
}
Tessy answered 27/1, 2016 at 20:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.