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

半城伤御伤魂 提交于 2019-12-12 03:03:56

问题


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>

回答1:


There are no Android Wear devices with an API-Level below 23. You are not restricting the customer base when uploading the App with a minimum SDK Version of 23.




回答2:


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" />



来源:https://stackoverflow.com/questions/41057431/google-play-apks-supporting-android-wear-must-have-a-minimum-sdk-version-of-at-l

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