Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
515 views
in Technique[技术] by (71.8m points)

c# - "aapt.exe" exited with code 1 when building Mono for Android project

I put together a fairly simple Mono for Android application that does nothing more than play an "AndroidResource" MP3 in a background service (copied from Greg Shackles latest Visual Studio Magazine article on Background Services in MfA). I put the code together, with my own custom MP3 file, and tried to build it, only to get this lovely error.

"aapt.exe" exited with code 1

That is the only info in the error list and build output log.

question from:https://stackoverflow.com/questions/11440741/aapt-exe-exited-with-code-1-when-building-mono-for-android-project

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Step 1: get more info

If you run across this error, hopefully, you will also run across a post from Jonathan Pryor replying to someone else with the same problem. The suggestion is to turn on more verbose logging from MSBuild to see if you get something useful out of those messages.

In the Visual Studio Options dialog, go to "Projects and Solutions" then "Build and Run". Switch the "MSBuild project build output verbosity" from "Minimal" to "Normal" and build your project again. After doing so, I got this message which was far more helpful. Apparently, resources cannot include anything but letters, numbers, periods, and underscores ([a-z0-9_.]).

MSBuild normal verbosity logging

Solution

Rename file within the required restrictions and build again.

While this error message may come up for far more situations than filename restriction issues, a filename change fixed this particular issue completely.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...