Xamarin Android : “aapt.exe exited with code 1.”

Posted by Matheus Guimaraes |29 Sep 15 |

Uncategorized

Sometimes Visual Studio craps out on us and gives some random errors which can be easily cleared out by restarting it. Unfortunately, this is not one of them.

If you see this error that means that genuinely something is breaking the Android packing process, even if the build may have succeed it.

This means there is not one single problem that causes this, but the good news is that it’s really easy to find out what the problem is.

It should be as easy as switching to your Output window and reading the log of all the steps up to when it failed.

This is the tricky part though. It may well be that you’ve even already done that but couldn’t find anything useful or the error message was too generic. Well then, what you are missing is that you have to set your MSBuild output to Normal verbosity. By default, it’s set to minimal.

In order to do that you go to Tools -> Options -> Projects and Solutions -> Build And Run then find where it says MSBuild project build output verbosity (on Visual Studio 2015 that’s a dropdow) and change it from Minimal to Normal if it isn’t set to that option already.

When I wrote this post my problem was that I named an image on the drawable folder with an illegal character in the file name.

Hopefully now you can find out what your problem is too 🙂