I\'m having lots of problems with Gradle and Android Studio.
Making changes in any resource in the project can randomly give an exception during compilation, this is
I ran into the same problem and issue was with my build directory, currently Android Studio supports directory path less than 100 characters.
Found solution for this:
In root build.gradle
allprojects {
buildDir = "/path/to/build/${rootProject.name}/${project.name}"
}
and docs https://gradle.org/docs/current/userguide/writing_build_scripts.html
It has happened to me for an Activity declared in the manifest whose title was remove from the string file.
This bug can be Anything related to resources. The best way to find the error is:
I removed an accidentally added header in the menu xml:
Remove this:
<?xml version="1.0" encoding="utf-8"?>
Leave this:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
I'm copying here my final update as an answer.
It finally seems like i solved this issue cleaning up my resources, removing some unused XML and an unused theme. This obviously does not answer this question that i guess is of common interest.
Navigating the web i found that AAPT is know to fail with SegFault11, and often it does not give any information about the real error which can be caused by:
As Dale Cooper suggested, you could also try to run Lint and see if it finds any warning about resources.
I'm trying to find links to users experiencing those other causes (It's been some time since the original question), i will update this answer when i'll find them back.
I had this issue after importing the eclipse project. Issue was from my side. In eclipse, I put a png image in drawable which was actually a jpg image (I just renamed the extension from .jpg to .png). It was working fine with eclipse but was failing when imported to Android Studio.
Execution failed for task ':app:mergeDebugResources'. Crunching Cruncher d.png failed
I just deleted the d.png and added a original png file. It worked!
I just had sort of the same problem, but on the processDebugResources
step. After a couple of hours I started to try running diffrent verisons of aapt
(/build-tools/[version]/aapt) and it turns out that they give one hell of different error messages. The one I was originally using was 19.0.1
which only gave me Segmentation fault
but when i tried out 18.1.1
I was suddenly pointed to a line in a menu.xml
which had a resource missmatch. The problem turns out to be that I hade removed the default @string/action_settings
because I thought I didn't use it.
Conclusion, trying different versions of aapt
may help you find a resource missmatch.