0

I am having trouble with getting rid of the error Cannot resolve symbol 'R'. I have done some research but none has worked. Among the tips i have tried out include Tools->Android->Sync Project with Gradle Files after which I executed the Build->Clean Project. The clean project command resulted with the following error;

Execution failed for task ':app:mergeDebugResources'. > Crunching Cruncher abc_btn_radio_to_on_mtrl_000.png failed

My xml files have the following error:

NOTE: This project contains Java compilation errors, which can cause rendering failures for custom views. Fix compilation problems first

Exception raised during rendering: action_bar

What might I be missing? I will appreciate any help or pointers.

Community
  • 1
  • 1
Biko
  • 332
  • 3
  • 15

2 Answers2

0

In the comments above, @Udit posted a link to another sort of related question from which I was able to get a solution. Incase you run into a similar problem, the solution is quite simple. Reboot Android Studio and then go to Build->Rebuild Project. Hope this will sort out your issue as it did mine. Thank you all for your contribution.

Biko
  • 332
  • 3
  • 15
0

Execution failed for task ':app:mergeDebugResources'. > Crunching Cruncher abc_btn_radio_to_on_mtrl_000.png failed

--->Is this error message from the gradle console?

Because this happened to me once when the PNG file I used wasn't a "pure" PNG file. Like for example: An image I found from the internet that wasn't really a PNG file(ex: jpg/Gif image) but I just renamed it to to a ".PNG" file upon saving it then directly copied this to res/drawable. So to fix this I deleted the image and used a real PNG file by either editing it on Photoshop or a real png file from the internet or whatever and then did @Biko's advice which was to Reboot Android Studio and then go to Build->Rebuild Project.

mangu23
  • 884
  • 9
  • 13