我尝试将新的 Android Wear 应用程序上传到 Google Play 开发者控制台,但收到以下消息:
使用 'android.hardware.type.watch' 功能的上传失败的 APK 必须具有至少 23 的最低 SDK 版本,而此 APK 有 20。如果您在手机 APK 中嵌入手表 APK,则手机 APK 不需要使用“android.hardware.type.watch”功能。
我的应用程序配置为 sdk 20。我需要它可用于 android 5.1。我的应用程序专为穿戴而设计,不适用于穿戴和手机/平板电脑。
我尝试过但没有帮助的事情:
1.删除
android:name="android.hardware.type.watch"
- 该应用程序可以上传,但我无法在虚拟手表设备上运行它,它说:
缺少使用功能手表,无法在手表上启动非手表 apk
2.而不是删除
android:name="android.hardware.type.watch"
我尝试将其更改为:
<uses-feature
android:name="android.hardware.type.watch"
android:required="false" />
- 该应用程序可以上传,但我无法在虚拟手表设备上运行它,它说:
缺少使用功能手表,无法在手表上启动非手表 apk
- 尝试将最小 sdk 从 20 更改为 23 - 该应用程序无法在 20-22 sdk 设备上运行。
我的清单文件:
<?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>