androidgoogle-playandroid-5.0-lollipopnexus-4

Unknown error code during application install "-505"


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.


Solution

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