While working on my latest cross-platform project using Xamarin I started to get a build error in my Android project that stated:
“aapt.exe” exited with code 1
Turns out this was due to the resources that I recently added to the project. The resource was a mp3 file that I downloaded from freesound.org. When adding resources the file name needs to follow the same naming rules for Java identifiers. The file I added had dashes which is not allowed. Renaming the file with underscores fixed that issue.
The other issue I discovered is that you need to make sure any resources you downloaded are unblocked. The project may build and deploy, but will crash. To unblock a file right-click on the file from File Explorer and select properties. Click on the Unblock button. Of course you only want to do this from any file you downloaded from a trusted source, and even then exercise caution.