简体   繁体   中英

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

I have tried to upload new Android wear app to google play developer console and I've got the following message:

Upload failed APKs that use the 'android.hardware.type.watch' feature must have minimum SDK version of at least 23, and this APK has 20. If you are embedding a watch APK inside a phone APK, the phone APK does not need to use the 'android.hardware.type.watch' feature.

my app is configured to sdk 20. I need it to be available for android 5.1. my app is designed for wear only and not for both wear and phone/tablets.

things I have tried and didn't help:

1.remove

android:name="android.hardware.type.watch"

-the app is abled to be uploaded but I couldn't run it on a virtual watch device, it says:

missing uses-feature watch, non-watch apks cannot be launched on a watch

2.instead of removing

android:name="android.hardware.type.watch"

I have tried changing it to:

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

-the app is abled to be uploaded but I couldn't run it on a virtual watch device, it says:

missing uses-feature watch, non-watch apks cannot be launched on a watch

  1. tried changing the minimum sdk from 20 to 23 -the app won't work on 20-22 sdk devices.

My manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.galepshtein.metronomewatch">

    <uses-feature
        android:name="android.hardware.type.watch"/>
    <uses-permission android:name="android.permission.VIBRATE"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@android:style/Theme.DeviceDefault">
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

没有API级别低于23的Android Wear设备。当您上传的SDK版本最低为23时,您没有限制客户群。

Android Wear 2.0 Developer Preview 4 has extensive documentation for your question, see the App Distribution topic.

To paraphrase:

  • Android Wear 2.0 apps need a minimum API level of 24
  • If you want to use the old distribution model (of using an embedded APK), you may use API level 23

It seems like you want to distribute a standalone Android Wear 2.0 app, so you should set the API level to 24.

Also, you must set up targeting for watches by providing <uses-feature android:name="android.hardware.type.watch" /> and mark the app as standalone (see this part of the docs) by specifying <meta-data android:name="com.google.android.wearable.standalone" android:value="true" />

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