0

Need help with an Android Play Store issue I've seen while trying to update our app.

The problem appears when the apk upload is done, and the following message shows up:

This configuration cannot be published for the following reason(s): It is forbidden that a device upgrading from API levels in range 14-18 to API levels in range 19+ should downgrade from version 10 to version 9, which would occur when Screen layouts containing any of [small, normal, large, xlarge] and Features containing all of [android.hardware.LOCATION, android.hardware.location.GPS, android.hardware.screen.PORTRAIT, android.hardware.TOUCHSCREEN, android.hardware.WIFI]. Some devices are eligible to run multiple APKs. In such a scenario, the device will receive the APK with the higher version code.

What is somewhat strange is that the Play Store lists our supported API levels as 14-18, whereas our SDK settings are as follows:

/* build.gradle */
...
android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "<my app id>"
        minSdkVersion 14
        targetSdkVersion 21
    }
...

/* AndroidManifest.xml */
...
android:versionCode="10"
    android:versionName="1.1.1" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="21" />
...

Another (perhaps minor) issue is that the following permission is listed under the APK DETAILS tab of the Play Store despite that we don't set this in our manifest file:
android.permission.CHANGE_WIFI_STATE

When we switch the build/target SDK version to 19 (as we previously did), Android Studio correctly complains that we are not using the latest Android version. Even then, we still see the upload problem.

Might there be something else in our configuration that is wrong? Thanks in advance for your assistance!

kip2
  • 6,473
  • 4
  • 55
  • 72
  • Are you using a library that perhaps has it's own manifest that sets this permission/config? – Tspoon Feb 11 '15 at 11:59
  • take a look: http://stackoverflow.com/questions/15275474/android-uploading-new-apk-with-updated-permissions-to-a-published-app , and: http://stackoverflow.com/questions/16060655/what-does-this-google-play-apk-publish-error-message-mean – Miki Franko Feb 11 '15 at 12:01
  • @Tspoon if that's the case then I'm not gonna worry too much about the random permission include. _MikiFranko the posted links seem to concern the case where multiple APKs are uploaded at once. In my situation, I'm just trying to put the updated APK into beta status first (I've always done this), before promoting it to production, which usually replaces the last APK. I've never had to unpublish the existing one first – kip2 Feb 11 '15 at 15:50

1 Answers1

0

OK, I finally managed to solve the issue.

  1. Used aapt to see how Play Store would parse the apk
  2. Found out that an external, closed-source library that I'm using sets a maxSdkVersion=18 in its manifest library
  3. Obtained a version of the offending library that doesn't have the max SDK setting.
  4. Recompiled the app and successfully uploaded to the play store.

An alternative to step 3 would have been to override the maxSdkVersion in my main AndroidManifest.xml file, or Disable Manifest Merger in Android Gradle Build in gradle, but Android Studio wasn't very cooperative on that front.

Admittedly, the error message on Play Store is rather cryptic and could be worded better.

Community
  • 1
  • 1
kip2
  • 6,473
  • 4
  • 55
  • 72