简体   繁体   中英

APKs supporting Android Wear must have a minimum SDK version of at least 23

I received this error while uploading my APK to GooglePlay: "APKs supporting Android Wear must have a minimum SDK version of at least 23, this APK has 20."

Both my mobile app and wear app have their minimum SDKs set to 20.

I've never had any problems updating my app previously, this appears to be a new restriction.

Is it a valid error? I thought the minimum SDK for Wear is 20 [Android 4.4W / Kitkat]

I tried un-ticking: "Pricing & Distribution: Distribute your app on Android Wear [ ]", but the error still occurs.

The problem is that I have folks using SDKs 21 & 22 as well. Also, while it is a dedicated Wear app, it has some utility as a standalone mobile app as well.

Any advice?

Apparently these rejections are due to changes Google made in preparation for Android Wear 2.0 standalone apps. Sometimes this restriction is inadvertently blocking phone apps that contain Android Wear 1.0 apps due to a manifest entry.

If you have a uses-feature manifest entry in your host/phone app for android.hardware.type.watch , remove it and you should be able to upload and get past the validation. Complete manifest entry below:

<uses-feature
    android:name="android.hardware.type.watch"
    android:required="false />

I have same problem and I couldn't find different solution to upload Multiple APK. This solution is not best(there is no wear support 23-) but no way to upload APK.

First I seperate AndroidManifest.xml 23- between 23+ cause of

<uses-feature
    android:name="android.hardware.type.watch"
    android:required="false"/>

App gradle:

productFlavors {
    demoVer {
        versionName = android.defaultConfig.versionName + "-TEST"
    }
    prodVer {
        signingConfig signingConfigs.config
        minSdkVersion 17
        maxSdkVersion 22
        versionCode 74
    }
    prodVerMin23 {
        signingConfig signingConfigs.config
        minSdkVersion 23
        versionCode 75
    }
}

dependencies {wearApp project(path: ':wearapp', configuration: 'prodVerMin23Release')}

Wear gradle:

compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    minSdkVersion 20
    targetSdkVersion 23
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
    prodVerMin23 {
        minSdkVersion 20
    }
}

I ran into the same problem and found that you have to upload Multiple APKs to Google Play. One APK which supports API level 23 and up (included wear 23 and up) and another one which supports API level 20 to 22 (included wear 20 to 22).

More info: https://developer.android.com/google/play/publishing/multiple-apks.html

PS: Sorry for my English.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM