Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

First build with AndroidStudio failed

I'm new to android programming and I'd like to use Android Studio for the start. I downloaded and installed AndroidStudio 0.8.0 on my Ubuntu 14.04 machine. I also set up java properly. When I create a new project (as told by http://developer.android.com/training/basics/firstapp/creating-project.html) it looks like it will try to build the sample files. But then I always get this error:

/home/daniel/AndroidStudioProjects/Heimweg/app/src/main/res/drawable-xhdpi/ic_launcher.png


Error:Error: Cannot run program "/home/daniel/android/android-studio/sdk/build-tools/android-4.4W/aapt": error=2, No such file or directory

Error:Execution failed for task ':app:mergeDebugResources'.

/home/daniel/AndroidStudioProjects/Heimweg/app/src/main/res/drawable-xhdpi/ic_launcher.png: Error: Cannot run program "/home/daniel/android/android-studio/sdk/build-tools/android-4.4W/aapt": error=2, No such file or directory

How can I deal with this error? When I try to run the app it says »ADB not responding. You can wait more, or kill "adb" process manually and click "Restart"«

like image 213
daniel7558 Avatar asked Jul 17 '14 16:07

daniel7558


People also ask

What is the default build tool in Android Studio?

Gradle build system. Android Studio uses Gradle as the foundation of the build system, with more Android-specific capabilities provided by the Android plugin for Gradle. This build system runs as an integrated tool from the Android Studio menu, and independently from the command line.


2 Answers

The Android tools need 32-bit compatibility libraries installed. I had the exact same problem, and this worked for me:

sudo apt-get install libc6-i386 lib32stdc++6 \
lib32gcc1 lib32ncurses5 lib32z1

Then restart Android Studio.

like image 184
Jason McVetta Avatar answered Oct 15 '22 06:10

Jason McVetta


It sounds like the SDK doesn't have all of the components installed!

To remedy this, in Android Studio go to Tools->Android->Android SDK Manager

I would install the Android SDK Tools, Android SDK Platform-Tools, and the Android 4.4 files (and the others as far back as you plan on developing for)

I hope this helps! Here's some reference with pictures if you need further assistance: http://developer.android.com/tools/help/sdk-manager.html

EDIT: I apologize! I should have read your error more carefully. It seems that android-4.4W refers to Android Wear.

Make sure when you are creating your project that you do not have Android Wear selected under the SDK selection screen (As shown below)

Select project compatibility

Alternatively you can also open up the Android SDK Manager again and install the Wear SDK. In the SDK Manager it is under Android 4.4W (API 20), install the SDK Manager and the two System Images

like image 21
Zolnoor Avatar answered Oct 15 '22 06:10

Zolnoor