android studio 错误:缺少功能:WATCH [英] android studio error : missing feature: WATCH

查看:29
本文介绍了android studio 错误:缺少功能:WATCH的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在我的智能手表上使用 android studio 运行一个简单的应用程序,但收到以下消息:

I have tried to run one simple application with android studio on my smartwatch and I've got the following message:

我的智能手表运行 android 4.4.2,其 API 级别为 19

my smartwatch runs android 4.4.2 which has API level 19

我尝试过但没有帮助的事情:

things I have tried and didn't help:

  1. 将最小 SDK 版本更改为 API 19

  1. change Min Sdk Version to API 19

删除<代码><使用功能 android:name="android.hardware.type.watch"/> 来自 androidManifest

remove < uses-feature android:name="android.hardware.type.watch" /> from androidManifest

-应用程序已安装,但当我尝试从手表运行它时,出现错误:不幸的是,我的应用程序已停止.我的应用崩溃时的日志

-the app is installed but when i try to run it from the watch i get the error: Unfortunately , My Application has stopped. logcat when my app crases

  1. 而不是删除

  1. instead of removing

<代码><使用功能 android:name="android.hardware.type.watch"/>

我尝试将其更改为:

但我有相同的结果

推荐答案

拥有元素

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

在您的清单中,Android Studio 表示这是一个 Android Wear 应用 - 而您的 D5 手表不运行 Android Wear.是的,它是一款运行 Android 的智能手表,但 Wear 是一套专门针对现有 Android 的 Google 专有(非开源)增强功能 - 而 D5 没有这些功能.

in your manifest is taken by Android Studio to mean that this is an Android Wear app - and your D5 watch doesn't run Android Wear. Yes, it's a smartwatch running Android, but Wear is specifically a set of Google-proprietary (not open-source) enhancements to stock Android - and the D5 doesn't have them.

在我的测试中,使用 android:required="false" 标记它允许将应用部署到非 Wear 设备.我不确定为什么这对你不起作用;也许这与 Android Studio 版本有关(我使用的是 v2.3).

In my testing, flagging it with android:required="false" allowed the app to be deployed to a non-Wear device. I'm not sure why this didn't work for you; perhaps it's to do with Android Studio versions (I'm using v2.3).

但无论如何,如果您删除该元素,应用程序应该部署在您的 D5 上.

But in any case, if you remove that element, the app should deploy on your D5.

这篇关于android studio 错误:缺少功能:WATCH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆