I've recently installed the newest stable version of Android Studio, on my Ubuntu 14.04 LTS. SDK been configured properly.
I created a single 'Activity' project from the blank Activity template, and made no changes to it.
When trying to build, or clean I get sporadically the followi:
Failed to complete Gradle execution.
Cause:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
That seems to be caused by VM's heap size. but adding XX:MaxPermSize=1024m
only makes it occur fewer times, meaning, sometimes I don't get this error, without changing anything.
so either its not the real solution, or 1024m is not enough (which doesn't seems right..)
However, when I don't get this error, build is still failing with:
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:checkDebugManifest
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
/home/a/Android/Sdk/build-tools/19.1.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
/home/a/Android/Sdk/build-tools/19.1.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
/home/a/Android/Sdk/build-tools/19.1.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
/home/a/Android/Sdk/build-tools/19.1.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
:app:mergeDebugResources FAILED
/home/a/AndroidStudioProjects/useless/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Error:Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/a/Android/Sdk/build-tools/19.1.0/aapt'' finished with non-zero exit value 127
Error:Execution failed for task ':app:mergeDebugResources'.
> /home/a/AndroidStudioProjects/useless/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: Error: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/a/Android/Sdk/build-tools/19.1.0/aapt'' finished with non-zero exit value 127
Information:BUILD FAILED
Information:Total time: 13.341 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console
witch is not really informative.
It might be that there are corrupted or locked system files that are causing the issue. Make sure you backup your Android projects onto a USB first - just in case. Show activity on this post.
Solved it (hoping so) by not using the Instant Run feature. Might not be the best solution but it works for now. Just go to "File -> Settings -> Build, Execution, Deployement -> Instant Run" and just disable it. With this Android Studio builds from scratch each time but it's better than not building it right.
Now Start your Android Studio you will see the start dialog with settings. Do the following to set your Android sdk path : Add new SDK and referencing to the SDK Folder that you have and then click apply and ok.
Try to open any of your earlier project or create new one and check. try syncing with Gradle after opening project. Depending on your AndroidStudio version, the settings are stored in ~/.AndroidStudio, ~/.AndroidStudio1.1 or ~/.AndroidStudio1.2. Open a terminal and run the following code:
OK, as strange is may this solves the problem (the second one). It's strange because there is no way to understand it from gradle outout.
You have to install These Packages to Solve this Error Because Android SDK Still not working on UBUNTU 64 Bit.
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With