Android studio 1.0.2 not building app:mergeDebugRe

2019-01-07 11:36发布

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.

2条回答
来,给爷笑一个
2楼-- · 2019-01-07 12:18

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)

查看更多
啃猪蹄的小仙女
3楼-- · 2019-01-07 12:34

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
查看更多
登录 后发表回答