Android xml error: "No resource found that matches the given name" with RelativeLayout (@id/LinearLayout_acc, @id/ProgressBar_statusScreen)

Solution 1:

change

@id/LinearLayout_acc

to

@+id/LinearLayout_acc

Solution 2:

Please check the below code

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/ic_launcher" >

<TableLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

<LinearLayout
    android:id="@+id/LinearLayout_dist"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_above="@+id/LinearLayout_acc"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="10dp" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="FIRST" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="SECOND" />
   </LinearLayout>

   <LinearLayout
    android:id="@+id/LinearLayout_acc"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_above="@+id/ProgressBar_statusScreen"
    android:layout_centerHorizontal="true" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="THIRD" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="FOURTH" />
   </LinearLayout>

   <ProgressBar
    android:id="@+id/ProgressBar_statusScreen"
    style="?android:attr/progressBarStyleHorizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_margin="16dp" />

 </RelativeLayout>

Also check the following link. It says that android:layout_below="@id/myTextView" won't recognise an element with id "myTextView" if it is written after the element you're using it in.