why am I getting the error "error executing aapt " - android

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

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.

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

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.

I got the same problem. What helped me was changing the Project Build Target
Properties->Android->Project Build Target

Related

why do i get the error "Gradle sync failed: Cause: startup failed: invalid token"?

Here's the link to build.gradle . I'm not able to find the error.
I fix your code and build it a success. You can see the PR in Github.
I think it just a little environment setting problem.
https://github.com/kabburesai/Demo/pulls
Update:
I build it again and find the styles.xml has incorrect, so I fix it also.
enter image description here
Unexpected token mostly means syntax error only. There's just a command(code, character or words) that was incorrectly placed.
According to your error, it points to your build.gradle (root).

Error in generated values.xml

I can't get my Android project to build any more. The first error comes up in a file located at PATH_TO_PROJECT/app/build/intermediates/res/merged/debug/values/values.xml and the error reads Error:(2251, 58) String types not allowed (at 'android:id' with value ''). That line is
<style name="Platform.ThemeOverlay.AppCompat" parent=""/>
But in the file, the line that has red text indicating an error is the first line after the <?ml line
<resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2">
with the part in quotes being red.
I also have a problem with my classes suddenly showing errors using R.id or R.menu or R.whatever, though I'm sure that's something that is a side result of the above issue.
I thought it might be that gradle was updated, but I haven't made any changes to the gradle app file, just updated from 2.2.0 to 2.2.2, would that have caused it?

Run projects from androidviews

I am trying to run the sample project from customviews but facing some problems. i am not able to run any project from the site. Each time getting different type of error. I also searched in the net for the solution but failed to figure out the solution. May be i am facing a general problem for all projects and if i solve one i may be able to solve the others.
In ActionbarPullRequest library i am getting :
Description Resource Path Location Type SmoothProgressBar cannot be resolved to a type DefaultHeaderTransformer.java /library_ActionbarPulltoRefresh/src/uk/co/senab/actionbarpulltorefresh/library line
57 Java Problem
In StackBlurDemo i am getting this error :
Description Resource Path Location Type toggleButtonMode cannot be resolved or is not a field MainActivity.java /StackBlurDemo/src/com/example/stackblurdemo line 30 Java Problem

Android: Gradle Error in Android Studio

I recently added some .gifs to my /drawable so that I can use them with buttons. This worked fine (no errors). Now, when I go to rebuild/run my application, I get the following error:
Error: Gradle: Execution failed for task ':MyProject:mergeDebugResources'. > Index: 0
I'm not sure how to fix this (and there appears to be no other similar issues that I could find online.
Edit: Now it's the same error, but it also says (at the end of the first error)
Running /Applications/Android Studio.app/sdk/build-tools/android-4.2.2/aapt failed. See output
Okay, I fixed the issue. It was quite weird.
A) I had some capital letters in my res/drawables folder. Not too weird -- I can see how that would remove the first error.
B) Then, however, a lot of values in my main activity file became undefined. I had to manually import 'com.myapp.R'. Now that was weird.
Fortunately, everything is now working.
I hope that if anyone gets the same errors as me, that this response can help them.

Segmentation fault with aapt

Trying to build and Android project using Maven, we are not able to compile it with google play services apklib with it.
I've tried to remove all the languages from the apklib, just keeping the default one, and it seems to be able to execute aapt with no problems.
Does anybody run into this problem? I've tried to do what Jake Wharton says in this website: https://github.com/JakeWharton/gms-mvn-install , but the Segmentation fault still happening.
Ideas?
Thank you for your time.
aapt: warning: string 'error_generic_text_toast' has no default translation in /Users/fjfernandez/Development/android-messenger/app/target/unpack/apklibs/com.google.android.gms_google-play-services_apklib_5/res; found: ca_ES cs de en eu_ES fr gl_ES it nl pt pt_PT sk
Segmentation fault: 11
The problem we had in code was in style. You cannot use #+id to make reference to any view ( I guess you should not reference any kind of view in your styles, but anyway).
No #+id in your styles.
Maybe you already solved this problem, but I find out if I don't define in Manifest package like "package=some.app.package" it gave me the same error like you had.
I had a menu file with unresolved #string reference. I copied the aapt command from the Eclipse Console tab and ran it in a standalone terminal window. I figured out the offending file from the aapt log.
(new resource id main from /home/paller/workspaces/android_dev/xxxxxx/res/menu/main.xml)
Segmentation fault (core dumped)
It does not look nice that aapt just crashes if it does not like something in its input files.
I just found out that when strings.xml contains %blabla%, aapt segfaults. I have created an issue here: https://code.google.com/p/android/issues/detail?id=68667

Categories

Resources