android studio 无法构建 [英] android studio cant build

查看:54
本文介绍了android studio 无法构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

FAILURE:构建失败,出现异常.

FAILURE: Build failed with an exception.

出了什么问题:任务:app:preDexDebug"的执行失败.

What went wrong: Execution failed for task ':app:preDexDebug'.

java.io.IOException: Cannot run program "C:\Users\SETIAWAN\AppData\Local\Android\sdk\build-tools\21.1.2\dx.bat": 
CreateProcess error=2, The system cannot find the file specified
Try: Run with --stacktrace option to get the stack trace. Run with -- info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 12.109 secs

任何人都可以提供帮助.当我尝试运行 dx.bat 时.错误 Windows 找不到此文件(dx.bat)

Anyone can help. When I try to run dx.bat. Error Windows can't find this file(dx.bat)

推荐答案

您可以多次添加 android-support-v4.jar.从项目的 build.gradle 中删除 android-support-v4.jar 的依赖项,只有一个依赖项,例如:

You may adding android-support-v4.jar for multiple times. Remove the dependencies of android-support-v4.jar from project's build.gradle and just have a single dependencies, such that:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
}

这篇关于android studio 无法构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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