After several trainings and workshops for my clients, I found a most annoying problem about Xamarin is ‘No Resource Found’ error in Xamarin.Droid. And finally, I and my student at Cyber Advanced System and Network, found a solid solution to solve this error.
What’s Xamarin.Droid’s error look like?: ‘No Resource Found’
We found this error raised many time even we updated Xamarin Studio to 6.0 and 6.1. So I assumed it still not be fixed yet. You might notice the error raised in style.xml
Error APT0000: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. (APT0000) (NextflowApp.Droid)
No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. (APT0000) (NextflowApp.Droid)
No resource found that matches the given name 'colorAccent'. (APT0000) (windowActionModeOverlay) (NextflowApp.Droid)
So if your error looks like us, let solve it together.
The causes of error, and How to solve it.
I found this solution worked with my client at Metropolitan Waterworks Authority of Thailand. It’s about Android SDK.
There’re 2 solutions, you can try the first, then the second if the first not work.
Solution 1: Android SDK Build Tools API 24
This solution has been talked a lot in Xamarin’s Forum and StackOverflow, that Android SDK’s Build Tools (API 24) raised this problem.
So let’s remove all Build-tools that labeled as API 24, and let the latest version of Build-tools API 23 remain.
After remove those Build-tools API 24, try to rebuild Xamarin.Droid project. Your error should be fixed.
Solution 2: Clear the cache of Xamarin.Droid package
In my experience, Xamarin.Droid packages might be the one that caused almost error. So you are free to remove them, then rebuild the project to restore it back
Go to following path in your machine (Please change Teerasej to your username)
- Windows: C:\Users\Teerasej\AppData\Local\Xamarin
- OS X/MacOS: /Users/Teerasej/.local/share/Xamarin/
After remove those folders, try to rebuild Xamarin.Droid project. Your error should be fixed.
Hope this help.