kleric
kleric

Reputation: 115

Target Downgrade

I have released an app on the app store with the target api being 23. A user has contacted me informing me that my app immediately crashes on devices running 23. After researching, a library my app is relying on crashes if the target is 23. I set the target to 22 which fixes the error, however, now google play will not let me update the app because "It is forbidden to downgrade devices which previously used M permissions (target SDK 23 and above) to APKs which use old style permissions (target SDK 22 and below)."

This is a paid app so I can't just remove it from the store and republish under a new name. Anyone run into this before? Any advice?

Upvotes: 0

Views: 2004

Answers (2)

ugur
ugur

Reputation: 3654

instead of downgrade you can add conditions for relate the parts of your code to the supported versions.

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M){
       //put whole code here if nothing supported for 23+
    }

Upvotes: 0

ianhanniballake
ianhanniballake

Reputation: 199805

As the error message states, once you set your targetSdkVersion to 23, you are using Android 6.0's runtime permissions and cannot downgrade to target an older targetSdkVersion.

As mentioned in the Picking your compile, min, and targetSdkVerison blog post:

That doesn’t mean you have to use every new feature introduced nor should you blindly update your targetSdkVersion without testing  — please, please test before updating your targetSdkVersion! Your users will thank you.

You'll have to update your app's compatibility with API 23, removing libraries that specifically prohibit targeting API 23 and ensuring that you request dangerous permissions at runtime.

Upvotes: 1

Related Questions