Dx target fails on spaces in Android SDK path

19 views
Skip to first unread message

Charles Harley

unread,
Dec 19, 2008, 8:49:15 AM12/19/08
to Auto-android
Hi,

I'm trying to use the excellent Android ant extension to automate my
build process but I've run into a problem with the <android:dx />
target. It seems the target tries to execute the dx.bat file, which I
have at 'C:\Program Files\Android SDK\tools', but can't, exiting with
the following error:

'''C:\Program' is not recognized as an internal or external command,
operable program or batch file."

It looks like the error is to do with the spaces in the path. Normally
I would just change the path to something without spaces but oddly the
<android:apk-builder /> target works fine running 'C:\Program Files
\Android SDK\tools\apkbuilder.bat' without hassle.

I've looked at the source code and they are both executed in
practically identical ways. Does anyone have any idea why this error
occurs? I'm using android-ant-rc2.jar.

Many thanks,

Charles

freepine

unread,
Dec 19, 2008, 9:54:22 AM12/19/08
to autoa...@googlegroups.com
Try to put in a new folder without space in directory's name.

freepine

unread,
Dec 19, 2008, 9:56:40 AM12/19/08
to autoa...@googlegroups.com
It was reported that ant works abnormally with space in file path:)

philhsmith

unread,
Dec 19, 2008, 11:12:34 AM12/19/08
to Auto-android
Hi, Charles,

Are you able to run the autoandroid build itself? You should be able
to check it (at http://autoandroid.googlecode.com/svn/trunk/ ) hop
inside and just run ant. It'll run the sample builds, which use dx.
If that explodes, please submit an issue ( http://code.google.com/p/autoandroid/issues/entry
). Either way, I'll run the build again on windows later today (don't
have a windows handy atm unfortunately) & see what there is to see.

Thanks!
--phil--

On Dec 19, 6:56 am, freepine <freep...@gmail.com> wrote:
> It was reported that ant works abnormally with space in file path:)
>

philhsmith

unread,
Dec 21, 2008, 1:42:06 AM12/21/08
to Auto-android
Things seem to be running normally on my windows copy, but that
doesn't mean it works in the general. If you're still getting
problems please (please please) file a bug so we can figure it out

On Dec 19, 8:12 am, philhsmith <phil.h.sm...@gmail.com> wrote:
> Hi, Charles,
>
> Are you able to run the autoandroid build itself? You should be able
> to check it (athttp://autoandroid.googlecode.com/svn/trunk/) hop
> inside and just run ant. It'll run the sample builds, which use dx.
> If that explodes, please submit an issue (http://code.google.com/p/autoandroid/issues/entry

Charles Harley

unread,
Dec 22, 2008, 8:52:37 AM12/22/08
to Auto-android
Hi Phil,

Thanks for the quick response! I got the latest source and ran the
sample notepad application build file. This failed with the same error
as I described in my first post. I moved the Android SDK files to a
path without spaces, updated the ANDROID_SDK environment variable and
ran the build file. This time it worked fine.

As further testing I kept the Android SDK files in the path containing
spaces, updated the ANDROID_SDK environment variable, and moved the
sample notepad application files (including the build file) to a path
that doesn't contain spaces and ran the build file. Strangely it
worked fine. Should the build run fine if the paths to the Android SDK
and the build file contain spaces? If so I'll submit an issue.

Many thanks,

Charles

On Dec 19, 4:12 pm, philhsmith <phil.h.sm...@gmail.com> wrote:
> Hi, Charles,
>
> Are you able to run the autoandroid build itself? You should be able
> to check it (athttp://autoandroid.googlecode.com/svn/trunk/) hop
> inside and just run ant.  It'll run the sample builds, which use dx.
> If that explodes, please submit an issue (http://code.google.com/p/autoandroid/issues/entry

philhsmith

unread,
Dec 23, 2008, 3:14:52 PM12/23/08
to Auto-android
So I was able to reproduce it on my end, and committed a fix. Please
update trunk and try it again. If that works for you, you could even
try copying the android-ant.jar out of target and into your own
project, to confirm the the problem is solved there. If it is, let me
know and I'll roll out a new version.

Thanks!

On Dec 22, 5:52 am, Charles Harley <charles.har...@googlemail.com>
wrote:

Charles Harley

unread,
Dec 24, 2008, 7:07:36 AM12/24/08
to Auto-android
That worked for me! Thanks for all your help Phil.

Charles
Reply all
Reply to author
Forward
0 new messages