Click here to Skip to main content
15,894,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.


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
Posted

1 solution

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.
 
Share this answer
 
Comments
OrangeFlash81 23-Jul-13 10:38am    
Thanks; I'm not executing these commands myself though, this is the output of Android Studio. How can I change which commands Android Studio is running?
H.Brydon 23-Jul-13 10:52am    
You didn't say what your build environment is but there has to be something in the build specifications that needs double quotes. The 'C:\Program' part of the error is a dead giveaway.
OrangeFlash81 23-Jul-13 11:12am    
I'm using Android Studio, and I'm simply clicking the 'Build' button. I'll have a look around the settings for Android Studio.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900