Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio 1.0.2 not building app:mergeDebugResources error

I just installed android studio on linux , configured the SDK and installed the building tools now when I try to sync with gradle or (build the app) it fails and throws this error :

Error:Execution failed for task ':app:mergeDebugResources'. /home/user_name/AndroidStudioProjects/project_name/app/src/main/res/drawable-hdpi/ic_launcher.png: Error: Cannot run program "/home/user_name/Android/Sdk/build-tools/21.1.2/aapt": error=2, No such file or directory Error:Error: Cannot run program "/home/user_name/Android/Sdk/build-tools/21.1.2/aapt": error=2, No such file or directory /home/user_name/AndroidStudioProjects/project_name/app/src/main/res/drawable-hdpi/ic_launcher.png

I tried to change the ' buildToolsVersion ' in my gradle file and it gave me the same error for 21.1.2 , 1 , 0 also.

like image 607
Abdelrahman Elkady Avatar asked Dec 21 '14 13:12

Abdelrahman Elkady


2 Answers

I solved the problem by running those commands

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

Ubuntu can't run the aapt on 64 bit before installing this packages

EDIT 19-04-2016 :

Android Studio 2 have the installation guide updated with those packages and bunch more to compile on 64-bit machines correctly

$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
like image 179
Abdelrahman Elkady Avatar answered Oct 31 '22 19:10

Abdelrahman Elkady


I had the same issue even after trying out the accepted solution. In my case the gradle build tool version that I've specified was not installed on my debian system. It worked like a charm after I changed the buildToolVersion to the installed version which was (23.0.2)

like image 24
Samuel Robert Avatar answered Oct 31 '22 18:10

Samuel Robert