aapt finished with non-zero exit value 127

时间:2015-08-07 01:38:07

标签: android

For 2 days, I have been trying to get a blank android activity to compile on intellij idea ultimate on Ubuntu 14.04 64-bit. This error has really stumped me:

Error:Gradle: Execution failed for task ':app:mergeDebugResources'.
> /home/guarddog/Documents/github/IcsTrac/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/res/drawable-ldrtl-hdpi/abc_ic_ab_back_mtrl_am_alpha.png: Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/android-sdk-linux/build-tools/22.0.1/aapt'' finished with non-zero exit value 127

Note I have Java 8, Gradle 2.5 and /usr/local/android-sdk-linux/tools all in my $PATH.

I tried the advice here: Gradle build failed in Android Studio. But the error still occurs. How can I resolve this issue?

3 个答案:

答案 0 :(得分:4)

我遇到了类似的问题。我安装了lib32z1并解决了问题。希望它可以提供帮助。

感谢@ agustin.aliaga的回答:

finished with non zero exit value

就我而言,我必须使用此命令在Ubuntu 15.04上安装libz.so.1库才能使其正常工作:

sudo apt-get install lib32z1

后来,我进行了深入的调查,发现在ubuntu 64 os中支持32位Android平台,应该安装32位库。

sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6

答案 1 :(得分:1)

关闭Android Studio,从项目位置删除build个文件夹,而不是打开AS并选择rebuild选项。

希望有所帮助。如果你还有这个问题,请告诉我。

编辑:请检查此问题: finished with non zero exit value

答案 2 :(得分:1)

我通常只做Build>重建项目或清洁项目

如果这不起作用,那么我去File> Invalidate / Caches重新启动并选择Invalidate and Restart