Exception raised during rendering: Could not find the value of the mock resource match 0x7F04001B (resolved name: content_main) in the current configuration

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

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

enter image description here

When I go to content_main , I see the correct image and rendering problems.

enter image description here

+7
android android-layout android-studio
source share
2 answers

I'm having the same problems as I updated Android Studio. This seems to affect only layouts with tags included in them.

If you go to “File”> “Invalid Cache / Restart ...”, click “Inactivate and Reboot”, then wait a minute or two to make sure that this will appear again.

Hope this helps!

+23
source share

The top answer didn't help me.

Here is another way to get rid of this error.

  • Go to the Project folder where the XML file is located (in case of an OP question, it will be the file content_main.xml ).
  • Rename the file to something else, for example, ren_content_main.xml .
  • Restore the project. The compiler will complain that the ren_content_main.xml resource does not exist. Ignore these errors.
  • Rename the file back to the original name ie content_main.xml .
  • Restore the project again.
  • Make sure that the error disappears like magic.

Hope this helps.

+1
source share

All Articles