Segmentation fault with aapt - android

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

Related

Android resource compilation failed (values.xml:200: error: invalid color)

I just begin learning Android with Kotlin, and I'm learning to build sliding intro. During build of my android application, I'm getting following error:
things in my color.xml:
Android resource compilation failed
Output:D:\HCI_Retry\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:200: error: invalid color.
Command: C:\Users\Nasri\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\bdf42a08a9c0a8f46dee8cc9eb34b57b\aapt2-3.2.1-4818971-windows\aapt2.exe compile --legacy \
-o \
D:\HCI_Retry\app\build\intermediates\res\merged\debug \
D:\HCI_Retry\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #7
I have tried to find solution toward my problem, but non of the solution actually helped with my problem. I had tried to open the values.xml file in hope to find the problem, but still got no clue.
Any help would be appreciated
From the colors.xml image, it looks like the issue is the missing # in colorHighlight. Should be #B6B6B6 instead of just B6B6B6.
KaiRuCheng disappeared and did not post line 200 of colors.xml as was asked in comments, but for all who is looking for solution for similiar problem:
I was encountered the same and found that it was just quotes around color code. I had this:
<color name="paragraph">"#FF0074E1"</color>
But should have to have this:
<color name="paragraph">#FF0074E1</color>
Note quotes around color code. It seems to be obvious error but despite of it Android Studio rendered correctly all elements which are using that color, and this error appears during building only.
I am not sure if this was the reason for KaiRuCheng's problem, as we can't see line 200 of his/her colors.xml, but this definetly was a reason for my problem which looked exactly same.
Similar answer: for me, I had typed #color/something instead of #color/something ... Android Studio would not underline it and the difference was so small, it took me 15 minutes to find the problem.
I also encountered with such problem when upgrading to Gradle 3.3.2. In my case, it was using Cyrillic instead Latin
<color name="default_button_press">#cc3b3b3b</color>
cc was Cyrillic and Android Studio didn't underline on old Gradle version.

Error building openframeworks for android: “ invalid use of incomplete type ‘class Poco::Path’”

I am trying to build an android application with OF. The application runs in two other computers. However, it does not work on mine. I am using a mac.
I run the command "make AndroidDebug" in the project folder, and this is the error I have:
/Library/openFrameworks/addons/ofxHTTP/libs/ofxHTTP/src/PostRouteFileHandler.cpp:98:46: error: invalid use of incomplete type 'class Poco::Path'
ss << Poco::Path(formFileName).getExtension();
I have installed poco, but nothing changes afterwards.
What can I do to solve this?
Thanks
Have you included Poco/Path.h?
A forward declaration might appeared earlier (possibly in another header) without complete definition.

"trouble writing output: Too many field references: 70185; max is 65536. You may try using --multi-dex option." when building Android project

I hit this error and found no hits for the error message, so I thought I'd share the solution I came up with to save anyone else facing the problem repeating my work.
When writing a new Android library (apklib) for use in a (large) application, I'm getting the following error during dexing when I add my new project as a dependency:
trouble writing output: Too many field references: 70185; max is 65536.
You may try using --multi-dex option.
References by package:
<...long list of packages with field counts elided...>
The particular build step it fails on is:
java -jar $ANDROID_SDK/build-tools/19.0.3/lib/dx.jar --dex \
--output=$PROJECT_HOME/target/classes.dex \
<... long list of apklib and jar dependencies elided ...>
Using --multi-dex as recommended by the error message might be a solution, but I'm not the owner of the application project and it already has a large complex build process that I would hesitate to change regardless.
I can reproduce this problem with a no-op test library project that has literally no fields, but in the error output it's listed as having 6000+ fields. Of the packages listed in the error output, there are a handful with similar 6k+ field counts, but then the vast majority have more plausible <1k field counts.
This problem is similar to the "Too many methods" problem that Facebook famously hacked their way around. The FB solution seems insane, and the only other solutions I've found (e.g., this Android bug ticket, or this one, this SO answer, this other SO answer) all involve changing the main app's code which is well beyond the scope of what I want to do.
Is there any other solution?
The solution was to change the package in the AndroidManifest to match the main application's package.
A manifest like this:
<manifest package="com.example.testlibrary" ...
resulted in 6k+ fields and build failure. Changing it to match the main application's package
<manifest package="com.example.mainapplication" ...
resulted in the project building successfully.
Note that only the package in the manifest is changing, I did not make any changes to the library's Java source or its layout (the Java package was still com.example.testlibrary with directory structure to match).
I hypothesize that the different package name is causing all the Android fields to be included again under that package. All the packages in the error listing with 6k+ fields had a different package name than the main application.
I also (later, grr), found this blog post which details the same problem and the eventual same solution.

why am I getting the error "error executing aapt "

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

Error while compiling libhardware_legacy

Two days ago i read some guides about how to self compile cyanogenmod and i wanted to try on my phone (Galaxy 3 i5800). The phone's CPU architecture is ARMV6 so i downloaded from androidarmv6.github.io the CyanogenMod 10.2 source code and from https://github.com/sdadier/cm10.1_device_samsung_apollo the device folder. At first compilation went pretty good except some "Selected Thumb mode not supported..." errors which i fixed by adding "-marm" CFLAG to involved Android.mk . However now i'm stuck on libhwardware_legacy compilation because i keep getting the error:
target thumb C: libhardware_legacy <= hardware/libhardware_legacy/wifi/wifi.c
hardware/libhardware_legacy/wifi/wifi.c: In function 'update_ctrl_interface':
hardware/libhardware_legacy/wifi/wifi.c:473:5: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
hardware/libhardware_legacy/wifi/wifi.c: In function 'wifi_start_supplicant':
hardware/libhardware_legacy/wifi/wifi.c:835:4: error: expected identifier before 'unsigned'
hardware/libhardware_legacy/wifi/wifi.c:895:20: error: dereferencing pointer to incomplete type
hardware/libhardware_legacy/wifi/wifi.c:912:26: error: dereferencing pointer to incomplete type
I searched on Google what that meant and i found lots of thread about this here on StackOverflow and on some Linux forums but none of them referred to Android, Cyanogen or libhardware_legacy. Is it a problem with my system? There is an error in the code (code here)?
Please give me some suggestion
OK! To fix the issue i removed "const prop_info *pi" and added this instead:
struct prop_info{
unsigned serial;
};
struct prop_info *pi;
but i think that if the system compiles it's not going to boot. However i will try to dump the libhardware_legacy from who compile CM10.1 successfully since the code is the same.
UPDATE: I probably found the main issue. The same error came up again and now there are 7 of them and the problem is that they are in the init so i can't workaround. However i noticed that wifi.c and property_service.c have an header in common sys/_system_properties.h probably the main error is there somewhere. Someone has a solution for this?

Categories

Resources