Android: “configuration cannot be published” while Uploading APK to Play Store

天大地大妈咪最大 提交于 2019-12-13 07:17:47

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/28453702/android-configuration-cannot-be-published-while-uploading-apk-to-play-store

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!