Android studio 1.0.2 未构建应用程序:mergeDebugResources 错误 [英] Android studio 1.0.2 not building app:mergeDebugResources error

查看:34
本文介绍了Android studio 1.0.2 未构建应用程序:mergeDebugResources 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在 linux 上安装了 android studio,配置了 SDK 并安装了构建工具,当我尝试与 gradle 同步或(构建应用程序)它失败并抛出此错误时:

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 :

错误:任务:app:mergeDebugResources"的执行失败./home/user_name/AndroidStudioProjects/project_name/app/src/main/res/drawable-hdpi/ic_launcher.png:错误:无法运行程序/home/user_name/Android/Sdk/build-tools/21.1.2/aapt": error=2, 没有那个文件或目录错误:错误:无法运行程序/home/user_name/Android/Sdk/build-tools/21.1.2/aapt":错误=2,没有那个文件或目录/home/user_name/AndroidStudioProjects/project_name/app/src/main/res/drawable-hdpi/ic_launcher.png

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

我尝试更改我的 gradle 文件中的"buildToolsVersion ",它也给了我同样的错误 21.1.2 , 1 , 0 .

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

推荐答案

我通过运行这些命令解决了问题

I solved the problem by running those commands

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

Ubuntu 无法在安装此软件包之前在 64 位上运行 aapt

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

编辑 19-04-2016 :

Android Studio 2 有安装指南更新这些包和更多在 64 位机器上正确编译

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

这篇关于Android studio 1.0.2 未构建应用程序:mergeDebugResources 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆