AndroidStudio Cannot Find Layout
Running AndroidStudio 3.6.2. A number of times I try to create a new fragment/activity, create a layout xml file, but when I try to use the layout AS shows an 'Unresolved reference' error. One option to 'fix' the problem is for AS to create the layout file for me. When I select this option the file is created, but AS still says it cannot resolve the reference to the file it just created. NOTE: It will find other layout files just fine, so it doesn't seem to be how I'm importing the resources.
Is this a known issue?
Here is the content of the layout file I created, just in case someone finds it helpful.
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<include
layout="@layout/content_video"
android:layout_width="4dp"
android:layout_height="2dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:layout_margin="16dp"
android:orientation="horizontal">
<ImageButton
android:id="@+id/switchVideoCamera"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_margin="8dp"
android:background="@android:color/transparent"
app:srcCompat="@drawable/ic_switch_camera_white_24dp" />
<ImageButton
android:id="@+id/display_video"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_margin="8dp"
android:background="@android:color/transparent"
app:srcCompat="@drawable/ic_videocam_white_24dp" />
<ImageButton
android:id="@+id/mute_audio"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_margin="8dp"
android:background="@android:color/transparent"
app:srcCompat="@drawable/ic_mic_white_24dp" />
<ImageButton
android:id="@+id/connectActionFab"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_margin="8dp"
android:background="@android:color/transparent"
app:srcCompat="@android:drawable/stat_sys_phone_call" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
I am facing the same problem. I just Restart Android studio with invalidate Cache and it's work for me.
But when I use the stable version for Android studio 3.6
it perfectly works for me.
Go to File->Invalidate Caches/Restart