why am I getting the error “error executing aapt ”

2019-09-06 07:38发布

问题:

I'm getting the error executing aapt :return code 1073741819 due to which .apk file is not generated how to fix this. How to fix if r.java file is missing

回答1:

It could be a syntax or formatting error in one of the XML files. I just got this error code (it's actually negative), and I checked all the @string references and they were OK. Eventually I figured out it was because of this item in a menu XML file:

<item
    android:id="@+id/action_stop"
    android:orderInCategory="100"
    android:icon="@drawable/ic_action_stop"
    android:showAsAction="ifRoom | withText"
    android:title="@string/action_stop"/>

However, the spaces around the | apparently aren't valid (XML isn't Java...). Eclipse didn't catch it as an error, but aapt crashed without giving a reason when it saw it. Not particularly graceful handling, by both Eclipse and aapt. Removing the extra spaces made everything work.

The problem with missing entries in strings.xml apparently produces error code -1073741816, not -1073741819. You have to look closely, but the last digit is different.

I'm not saying the problem is definitely some sort of syntax error. But it's another possibility that could be investigated.



回答2:

I got this error when I had deleted a @string entry that was being referenced in a menu node xml resource.



回答3:

I had this error and spent time trying to find a solution.

Finally the solution for this error which is: -1073741819 ( check the digits ) was a library was missing from: Properties -> Android -> Library I just added the missing libraries and got this error resolved.



回答4:

I got the same problem. What helped me was changing the Project Build Target

Properties->Android->Project Build Target