Reputation: 1299
I was trying to create a new project for android wear in eclipse , but there is a problem in main layout i don't now how i can solve it , this is my main layout:
<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>
it is give me this error :
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'
my project have two layouts "rect.xml" and "round.xml" and it is compile with 4.4W and target is 4.4W and also i have a copy of classes.jar in libs folder .
Upvotes: 3
Views: 4309
Reputation: 771
What worked for me was changing this: xmlns:app="http://schemas.android.com/apk/res-auto"
To: xmlns:app="http://schemas.android.com/apk/com.mydomain.myapp"
Where com.mydomain.myapp is the package id of my app.
Presumably the res-auto functionality was not working in my project for some reason.
Upvotes: 1
Reputation: 21
I just added the following code in the dependency section in my build.gradle
of the module:
compile 'com.google.android.support:wearable:2.0.3'
compile 'com.google.android.gms:play-services-wearable:11.0.0'
Upvotes: 1
Reputation: 10713
The code you've posted is fine. The problem here is that you have a copy of classes.jar
in your /libs
folder, but this is not a right way to properly use wearable-support-lib. This wearable-support-lib contains some resources that cannot be packaged inside a .jar
file, so you need to import it as a "Library project" and attach it to your project just like other external libraries.
You need to go back to the wearable-1.0.0.aar
file, located in relation to your sdk folder:
./extras/google/m2repository/com/google/android/support/wearable/1.0.0/wearable-1.0.0.aar
wearable-1.0.0.aar
file somwehere to your workspace. You will see that it looks almost like a standard android project.classes.jar
to /libs/classes.jar
- inside this project, not to your own project.android.support.wearable
.You can see more details about using wearable-support-lib in my other answer and in this great blog post (by Benjamin Cabé).
Upvotes: 5
Reputation: 178
I got this problem too sometimes, in my case i solved it by rightclicking on the AppCompat map then click on refresh, do this with your projectfolder too.
Upvotes: 0