Abd*_*zmy 3 java android wear-os
我试图在eclipse中为android佩戴创建一个新项目,但是在主要布局中有一个问题我现在不知道如何解决它,这是我的主要布局:
<android.support.wearable.view.WatchViewStub
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/watch_view_stub"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rectLayout="@layout/rect"
app:roundLayout="@layout/round"
tools:context=".MyActivity"
tools:deviceIds="wear">
</android.support.wearable.view.WatchViewStub>
Run Code Online (Sandbox Code Playgroud)
它给我这个错误:
Multiple annotations found at this line:
- error: No resource identifier found for attribute 'rectLayout' in package
'com.example.wear'
- error: No resource identifier found for attribute 'roundLayout' in package
'com.example.wear'
Run Code Online (Sandbox Code Playgroud)
我的项目有两个布局"rect.xml"和"round.xml",它是用4.4W编译的,目标是4.4W,而且我在libs文件夹中有一个classes.jar的副本.
您发布的代码很好.这里的问题是classes.jar你的/libs文件夹中有一份副本,但这不是正确使用wearable-support-lib的正确方法.这个wearable-support-lib包含一些无法打包到.jar文件中的资源,因此您需要将其作为" 库项目 " 导入,并像其他外部库一样将其附加到项目中.
您需要返回wearable-1.0.0.aar与您的sdk文件夹相关的文件:
./extras/google/m2repository/com/google/android/support/wearable/1.0.0/wearable-1.0.0.aar
wearable-1.0.0.aar文件解压缩到您的工作区.你会发现它看起来几乎像一个标准的android项目.classes.jar到/libs/classes.jar-这个项目中,而不是你自己的项目.android.support.wearable.您可以在我的其他答案和本篇博文(BenjaminCabé)中看到有关使用wearable-support-lib的更多详细信息.
| 归档时间: |
|
| 查看次数: |
3871 次 |
| 最近记录: |