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
In my case closing and reopening Android studio solved the problem. Rebuilding the project or clearing the cache didn't help.
You can also try this :
File => Invalidate Caches / Restart => Invalidate and Restart.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With