Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The layout <layout> in layout has no declaration in the base layout folder [error]

I am getting the following error in Android Studio on my app's layout:

The layout in layout has no declaration in the base layout folder; this can lead to crashes when the resource is queried in a configuration that does not match this qualifier

One of the layouts that I am getting this error is:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@null" >

      <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="top|center_horizontal"
            android:adjustViewBounds="true"
            android:contentDescription="@string/hello_world"
            android:src="@drawable/loading_top" />

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|center_horizontal"
            android:adjustViewBounds="true"
            android:contentDescription="@string/hello_world"
            android:src="@drawable/loading_bottom" />

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:contentDescription="@string/hello_world"
            android:background="@color/white"
            android:layout_marginBottom="5dp"
            android:paddingTop="10dp"
            android:paddingBottom="10dp"
            android:src="@drawable/loading_logo" />

        <ImageView
            android:id="@+id/loading"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center|center_vertical"
            android:layout_marginBottom="0dp"
            android:layout_marginTop="0dp"
            android:contentDescription="@string/hello_world"
            android:scaleType="fitXY"
            android:src="@null" />
    </FrameLayout>
</LinearLayout>

I get the error on the first line of the first LinearLayout.

Does anyone know how to solve this error?

Thank you

UPDATE: Answered my question with what has resolved the problem for me

like image 643
L Kemp Avatar asked Sep 28 '22 15:09

L Kemp


2 Answers

In my case closing and reopening Android studio solved the problem. Rebuilding the project or clearing the cache didn't help.

like image 284
vovahost Avatar answered Oct 19 '22 18:10

vovahost


You can also try this :

File => Invalidate Caches / Restart => Invalidate and Restart.

screenshot

like image 85
Itoun Avatar answered Oct 19 '22 20:10

Itoun