我按照
this link的说明在Android Studio中创建了一个简单的移动/可穿戴应用程序.但是,它不会识别任何特定于可穿戴SDK的类,会出现错误“无法解析符号______”.
this link的屏幕截图就是我所看到的.
以下是我的build.gradle文件:
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:+' }
我已经使用SDK管理器安装了所有SDK,我尝试在build.gradle文件中修改最小,目标和编译SDK,将它们设置为19,20或Android-L,但我的结果相同 – 由于这些无法识别的类,程序将无法编译.任何输入都表示赞赏!谢谢