1

At this moment a version of my app is on production with minSdkVersion 16. Currently I'm trying to deploy in beta channel new version with minSdk 19 but I'm getting this error:

     {
    "code" : 403,
    "errors" : [ {
      "domain" : "androidpublisher",
      "message" : "Devices with version 49 of this app target SDK 27 and would be upgraded to version 26 which targets SDK 20. This is forbidden as you cannot upgrade away from M permissions."
,
      "reason" : "multiApkDowngradedTargetSdk"
    } ],
    "message" : "Devices with version 49 of this app target SDK 27 and would be upgraded to version 26 which targets SDK 20. This is forbidden as you cannot upgrade away from M permissions."
  }

If I leave it like before, with minSDK16 works but not when I change it to even API 17/18/19 won't work.

I'm using this plugin for deploy on release apk: gradle-play-publisher

Do you have and idea for a workaround? Definitely I need to increase the min support version to 19.

Thanks

Borislav Kamenov
  • 561
  • 4
  • 12
  • 1
    That looks more like a targetSdk issue. Has that changed between the apk on production and the apk you're trying to upload now? – rjr-apps Feb 23 '18 at 23:13

1 Answers1

0

You can leave minSdk wherever you want it (eg 19), as long as you make sure targetSdk is at least 23.

Let me explain in detail what is going on. With SDK 23 (Android M) the ability came in to request runtime permissions. When this happens, a user doesn't accept the permissions at install time, instead the app requests them, and the user grants them as the permissions are needed.

Old apps, written to target SDK <23 were allowed to keep requesting permissions at install time. However, once a user has installed an App that targets SDK 23, you can't automatically upgrade them from that app (as they haven't accepted any permissions) to one with install time permissions. Then the user might have an app installed with permissions they didn't accept.

From the error message, it looks like you are trying to take away one version (49) which had target SDK 27, and replace it with an APK with target SDK 20. The best solution is to take your new APK, and give it whatever minSdkVersion you want, but make sure targetSdkVersion in your app's manifest is at least 23. Then this warning will go away.

Nick Fortescue
  • 13,530
  • 1
  • 31
  • 37