I was trying to work out with multiple layout using some online tutorials. The thing is my program was building and compiling correctly as long as there was only one XML fil
what I tried:
What Worked:
1. Invalidate caches and restart.
The stupid mistake I made to cause this error was to have the wrong package string in my AndroidManifest.xml
file. I'd left the string set in the tutorial, but had used my own when setting up the project.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="COM.YOU.YOURAPPNAME"
android:versionCode="1"
android:versionName="1.0" >
This is happening due to resources are not loading properly and the similar issue can occur any view also so Below are some technics which you can use to remove this error:-
Note: In the above-mentioned steps, the last step will work for this issue for sure.
There is probably an issue with the layout files, correct it and the auto generated class will appear.
Check if you not imported android.R accidentally.
I had a similar problem.
It happened suddenly, after deleting some pictures from res. drawable.
I did two things.