Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle execution error in Android Studio (Ubuntu)

I have a fresh install of Ubuntu and Android Studio. I have installed open jdk7 (for some reason it ended up in directories suffixed "amd64" even though I am running an Intel CPU, but I guess that's just a name?) as well as some SDK files.

I then created an empty project and now I am getting an error displayed near the bottom of the window. I guess this is a Gradle error (am very new to AS)

Error:Execution failed for task ':app:mergeDebugResources'.
> /root/AndroidStudioProjects/HockeyGame/app/build/exploded-aar/com.android.support/appcompat-v7/19.1.0/res/drawable-xxhdpi/abc_ic_voice_search.png: Error: Cannot run program "/opt/android-studio/sdk/build-tools/android-4.4.2/aapt": error=2, No such file or directory

I was thinking maybe this was a file privilege problem (because aapt does indeed seem to exist), so I set the privileges to 775 recursively. And I am also starting AS with sudo (sudo sh studio.sh).

Any ideas? I am partly trying AS out in Android because I was having problems getting it to run under a cluttered Windows install (and also for the fun of it), so this is disappointing.

edit: It turned out 64-bit Ubuntu isn't fit to run 32-bit executables out of the box.

like image 240
Christofer Ohlsson Avatar asked May 04 '14 13:05

Christofer Ohlsson


People also ask

What is Gradle error in Android Studio?

In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.

How do I sync Gradle with Android Studio?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.

How do I disable Gradle offline mode?

Go to File -> Settings. Then uncheck -> Offline work on the right. Click the OK button.


1 Answers

I solved it by running

sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1

Reference: https://code.google.com/p/android/issues/detail?id=67155

like image 106
Jayakumar Bellie Avatar answered Sep 21 '22 07:09

Jayakumar Bellie