无法在Android Studio中构建任何项目(任务执行失败':HelloWorld:dexDebug') [英] Can't build any projects in Android Studio (Execution failed for task ':HelloWorld:dexDebug')

查看:209
本文介绍了无法在Android Studio中构建任何项目(任务执行失败':HelloWorld:dexDebug')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我做了一些测试项目,我正在尝试构建它们,但我在消息窗口中收到错误1。完整错误说:

Hello,

I have made a few test projects and I am trying to build them, but I am getting Error 1 in the Messages window. The full error says:

Gradle: Execution failed for task ':HelloWorld:dexDebug'.
> Failed to run command:
	C:\Users\Aaron\AppData\Local\Android\android-studio\sdk\build-tools\android-4.2.2\dx.bat --dex --output C:\Users\Aaron\AndroidStudioProjects\HelloWorldProject\HelloWorld\build\libs\HelloWorld-debug.dex C:\Users\Aaron\AndroidStudioProjects\HelloWorldProject\HelloWorld\build\classes\debug C:\Users\Aaron\AndroidStudioProjects\HelloWorldProject\HelloWorld\build\dependency-cache\debug C:\Users\Aaron\AppData\Local\Android\android-studio\sdk\extras\android\m2repository\com\android\support\support-v4\13.0.0\support-v4-13.0.0.jar
Error Code:
	1
Output:
	'C:\Program' is not recognized as an internal or external command,
	operable program or batch file.





可以anybod你帮帮我吗?这是因为我通过studio.bat运行Android Studio吗?它不会通过正确的图标开始,我得到'无法加载JVM DLL',但我的JDK_HOME和JAVA_HOME都设置正常。



谢谢,



OrangeFlash81



Can anybody help me out here? Is this because I am running Android Studio through studio.bat? It won't start through the proper icon, I get 'Failed to load JVM DLL', but my JDK_HOME and JAVA_HOME are both set up fine.

Thank you,

OrangeFlash81

推荐答案

每当你有一个包含空格的文件规范时,你通常需要把双引号中的整个文件名。从消息来看,这似乎是一些Windows版本。如果您尝试执行命令行C:\Program Files \ blah \ blah.exe param1 param2或类似命令行,则需要指定:



Whenever you have a file spec that includes spaces, you typically need to put the entire filename in double quotes. From the message, this seems to be some Windows version. If you are trying to execute a command line "C:\Program Files\blah\blah.exe param1 param2" or similar, you need to specify:

"C:\Program Files\blah\blah.exe" param1 param2





而不是只需





and not just

C:\Program Files\blah\blah.exe param1 param2





请注意,程序和文件之间有一个空格。如果空间不存在,您可以跳过双引号。因为空间在那里,你需要引号。



Note that there is a space between "Program" and "Files". If the space was not there, you could skip the double quotes. Because the space is there, you need the quotes.


这篇关于无法在Android Studio中构建任何项目(任务执行失败':HelloWorld:dexDebug')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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