After migrating to Android Studio 3.2, API 28, I am getting the following error on my app\'s layout:
The layout in layout has no declaration in the base lay
In my case closing and reopening Android studio solved the problem. Rebuilding the project or clearing the cache didn't help.
If you devise your layout : layout-sw320dp layout-sw480dp layout-sw600dp layout-sw720dp ....
you should add layout by default like this:
What worked for me is to remove the id attribute
android:id="@+id/[id same as filename]"
from the layout resource.
I solved this issue by just syncing project with gradle
I had an issue after copy/pasting code into an XML layout file, but I fixed it by just manually creating the file. Very strange, since the code was exactly the same, but somehow it fixed this issue. I did try restarting and doing the "File => Invalidate Caches / Restart => Invalidate and Restart" fix, but the issue was only fixed by manually recreating the file.
In my case it seems that Google used to expect (or at least accept) different names between different layouts; I had a time_dialog.xml
and a time_dialog_landscape.xml
. Renaming the latter to time_dialog.xml
fixed the problem.