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

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.


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.