21

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

enter image description here

my smartwatch runs android 4.4.2 which has API level 19

things I have tried and didn't help:

  1. change Min Sdk Version to API 19

  2. 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. instead of removing

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

I have tried changing it to:

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

but i have the same result

E.Volt
  • 235
  • 1
  • 4
  • 8

5 Answers5

29

Having the element

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

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.

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).

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

Sterling
  • 6,365
  • 2
  • 32
  • 40
  • if i remove then my application is installed but when i try to run i i have an error.(i said that at my post look at it).What i did is that i created a project for tablet and phone.my app is now running with no error at my D5 watch.If i try to access some of the watch features like gps location or the heart monitor, do you know if i will have a problem?Beause like i said i created a project for phone and tablet and not for watch. – E.Volt Mar 05 '17 at 17:54
  • Your logcat indicates an error attempting to use features from 'android.support.wearable', part of Android Wear (and thus not available on your D5). You should be able to write a standard Android app for the D5 (including GPS, not sure about HRM), but you won't be able to use features from Wear. – Sterling Mar 05 '17 at 19:34
8

I solved it like this

You just need to remove the following tags from the manifest

<uses-library android:name="com.google.android.wearable" android:required="false" />


tools:ignore="GoogleAppIndexingWarning"


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

I hope you solve problem

Ali
  • 2,702
  • 3
  • 32
  • 54
habeeb mahran
  • 81
  • 1
  • 1
2

Check Running target before running

Screenshot

whiterook6
  • 3,270
  • 3
  • 34
  • 77
1

You need to change your app to support cpu architecture and so on. I copy a part form the link below. read for more information.

Supporting multiple CPU architectures

When using the Android NDK, you can create a single APK that supports multiple CPU architectures by declaring each of the desired architectures with the APP_ABI variable in the Application.mk file.

For example, here's an Application.mk file that declares support for three different CPU architectures:

APP_ABI := armeabi armeabi-v7a mips APP_PLATFORM := android-9

EDIT:

enter image description here

Mehran Zamani
  • 831
  • 9
  • 31
  • i think so. do you have AMD cpu? – Mehran Zamani Mar 04 '17 at 16:03
  • yes i have and i tried my bios setup but there is no option about enabling AMD-V.(The only option i have is enable SVM support if this helps) – E.Volt Mar 04 '17 at 16:08
  • unfortunately i can not find the Application.mk file in my project – E.Volt Mar 04 '17 at 17:03
  • when using `Android NDK`. did you have it? – Mehran Zamani Mar 04 '17 at 18:21
  • i don't think that i am using NDK.Do you know where Application.mk should be? – E.Volt Mar 04 '17 at 19:59
  • i don't know much about wearable application but i can say if you pass [these steps](https://developer.android.com/training/wearables/apps/creating.html#environment) you are going to be fine. – Mehran Zamani Mar 05 '17 at 05:26
  • OOOO. [you are trying to run your wearable app in a mobile device!!!](http://stackoverflow.com/questions/25621818/no-missing-feature-watch-when-i-try-to-run-my-smartphone-app-with-wear-app) – Mehran Zamani Mar 05 '17 at 06:00
  • no i am not.What i thought is that android studio does not support my smartwatch because it has API level 19.(Although i set min sdk version to API 19 ) http://stackoverflow.com/questions/41057431/google-play-apks-supporting-android-wear-must-have-a-minimum-sdk-version-of-at-l/41220399 – E.Volt Mar 05 '17 at 11:07
0

Here is the solution, change the edit configuration from app to your Android Wear package name. The Wear emulator will become 'compatible' when you click on the green run icon on Android Studio.

Note: If you have added the WearOS project to an existing Android project, don't forget to change the configuration back to 'app' so that you can run your Android app on the emulator/phone.

Cheers!

inspiredMichael
  • 370
  • 4
  • 9