【发布时间】:2014-07-22 16:10:52
【问题描述】:
我按照说明 here 在 Android Studio 中构建了一个带有移动和穿戴组件的简单应用。我的移动活动中有以下代码,试图调用磨损模块中的 MyWearActivity:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
Intent intent = new Intent(this, MyWearActivity.class);
startActivity(intent);
}
我的移动 build.gradle 文件具有以下依赖项:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.android.support:appcompat-v7:20.+'
compile 'com.google.android.gms:play-services-wearable:+'
compile 'com.google.android.support:wearable:+'
}
但是,我收到以下错误“无法解析符号 MyWearActivity”,尝试从 Android Studio 运行“移动”运行配置。我认为 wearApp project(':wear') 位会处理移动依赖磨损,但似乎没有。谁能确定我哪里出错了?谢谢
【问题讨论】:
标签: android android-studio android-gradle-plugin wear-os