Nic Capdevila Nic Capdevila - 1 year ago 72
Android Question

Android Play Store Error -505

When uploading an APK to the Android Developer Console, everything goes normal, but there are a certain subset of users on android 5.0 and up that are unable to install or upgrade the APK. These users see a Google Play Store error 505.

Answer Source

There are several different resources that tell you that the 505 error is a conflict of permission. Starting in Android Lollipop, you are no longer able to have duplicate custom permissions with the same name If you check stackoverflow for this error you'll find multiple reports of people offering this as a solution. While this can sometimes be the cause of this error there are several other reasons that this, and other conflicts can happen.

1. More than one app defines the same permission

If two completely different apps define the same permission e.g if you have a user and a manager app, and both of them have something along the lines of:

        android:protectionLevel="signature" />

2. Same app signed by different keys

You have the same app, but signed by different keys. For example if you had a release version and a debug version, you'll hit a conflict because the system sees this as two different apps requesting the same permission.

3. Conflicting authorities

But there is an entirely different situation that can occur, which is less obvious. The 505 error can also occur with conflicting authorities. If two different apps declare the same provider, such as

    android:exported="false" />

This can also provide a conflict.

The last, and hardest conflict to spot, is one that can happen with Google Play Services 8.1 and up. If you do not define an application id in your build.gradle file like this:

defaultConfig {
    applicationId ""

it is possible that it will auto-generate a provider that can conflict with other apps. To check this, go into your your build>intermediates>manifests>full>release>AndroidManifest.xml and look for

    android:exported="false" />

Here the authority name will conflict with other apps. If you add the applicationId to the default config, it will change this authority to

    android:exported="false" />

This is very subtle and appears to be a bug starting in google play services 8.1. The issue can be seen discussed here.

The point to remember is that it may be several things, and the only thing you can verify for sure with a 505 error is that there is a conflict of some sort, and that it may or may not necessarily be a custom permission conflict.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download