Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: No resource identifier found for attribute 'roundLayout' in package "package name"

I have had a problem with the following attributes app:RectLayout and app:Roundlayout, it gives errors in the xml, saying that there is

Multiple annotations found at this line: - error: No resource identifier found for attribute 'roundLayout' in package 'com.rarster.demowearman' - error: No resource identifier found for attribute 'rectLayout' in package 'com.rarster.demowearman'',

and then also gives an error in my main activity saying that R cannot be resolved to a variable, i am following this tutorial https://medium.com/@tangtungai/how-to-develop-and-package-android-wear-app-using-eclipse-ef1b34126a5d. I have checked that i do have the roundlayout and rectlayout in my layout folder. Can anybody tell me what is going on and how to fix it? Thanks in advance

the code that the error is in is

    <?xml version="1.0" encoding="utf-8"?>
<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="wrap_content"
    android:layout_height="wrap_content"
    app:rectLayout="@layout/rect"
    app:roundLayout="@layout/round"
    tools:context="com.rarster.demowearman.MainActivity"
    tools:deviceIds="wear" >

</android.support.wearable.view.WatchViewStub>
like image 530
ilikeyoyo Avatar asked Nov 22 '25 19:11

ilikeyoyo


1 Answers

  1. All xml attributes start with the lowercase letter.
  2. Neither app:rectLayout nor app:roundLayout should be placed in the manifest! They have to be used in layout file - in WatchViewStub parent view.

Like that:

<android.support.wearable.view.WatchViewStub
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/stub"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    app:rectLayout="@layout/rect"
    app:roundLayout="@layout/round"
    />

Your R cannot be resolved to a variable error is the effect of wrong resources files - they cannot be successfully compiled. So please fix the things above and all should be good.

like image 67
Maciej Ciemięga Avatar answered Nov 25 '25 10:11

Maciej Ciemięga