Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception raised during rendering: Could not find layout resource matching value 0x7F04001B (resolved name: content_main) in current configuration

Getting this exception when I created a new project with a new Activity.

Exception raised during rendering: Could not find layout resource matching value 0x7F04001B (resolved name: content_main) in current configuration.

enter image description here

When I go into the content_main, I do see a proper image and no rendering problems.

enter image description here

like image 413
user1406716 Avatar asked Jun 07 '16 22:06

user1406716


3 Answers

Here is another way to get rid of this error.

  1. Go to the Project folder where the XML file resides, (in the case of OP's question, this would be the content_main.xml file).
  2. Rename the file to anything else such as ren_content_main.xml.
  3. Rebuild the project. The compiler will complain that ren_content_main.xml resource does not exist. Ignore these errors.
  4. Rename the file back to the original name i.e content_main.xml.
  5. Rebuild the project again.
  6. Watch the error disappear like magic.
like image 112
Arlyn Avatar answered Oct 19 '22 19:10

Arlyn


I have been getting the same issues since I updated Android Studio. It seems to be affecting only layouts with include tags in them.

If you go to "File > Invalidate Caches/Restart...", click "Invalidate and Restart", then wait a minute or two wile AS does its thing it should cause them to show up again.

like image 41
Dan Avatar answered Oct 19 '22 18:10

Dan


go to "File > Invalidate Caches/Restart...", click "Invalidate and Restart",then comment out whole code then remove the comment. It worked for me.

like image 1
Arya Prakash Avatar answered Oct 19 '22 18:10

Arya Prakash