Compiling a simple downloadable application in Android Studio - WatchActivity not found

I followed the instructions in this link to create a simple mobile / wearable application in Android Studio. However, it does not recognize any of the classes related to the wearable SDK, since the error "cannot resolve the ______ character". A screenshot of this link is what I see.

Below is my build.gradle file:

apply plugin: 'com.android.application' android { compileSdkVersion 20 buildToolsVersion '20.0.0' defaultConfig { applicationId 'com.example.lsykora.androidwearwidget' minSdkVersion 'L' targetSdkVersion 'L' versionCode 1 versionName '1.0' } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard- rules.pro' } } productFlavors {} } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') // You must install or update the Support Repository through the SDK manager to use this dependency. // You must install or update the Support Repository through the SDK manager to use this dependency. compile 'com.android.support:support-v13:+' compile 'com.google.android.support:wearable:+' compile 'com.google.android.gms:play-services-wearable:+' } 

I installed all the SDKs using the SDK manager, and I tried to process with a minimal, target and compiling SDK in the build.gradle file, setting them to 19, 20 or Android-L, but I have the same results - the program will not compile from - for these unrecognized classes. Any input is appreciated! Thanks

+6
source share
1 answer

Do not WatchActivity (this class does not actually exist).

The base class for Android Wear actions is the standard Activity .

(In addition, if you use Android Studio 0.8.0, updating to 0.8.1 - 0.8.0 has an error in your templates and creates new actions using extend WatchActivity , which is actually not valid).

+8
source

Source: https://habr.com/ru/post/971980/


All Articles