Home » Android » java – First build with AndroidStudio failed

java – First build with AndroidStudio failed

Posted by: admin June 15, 2020 Leave a comment

Questions:

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”«

How to&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.

Answer:

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