'ant debug': BUILD FAILED, tools/dx not found

303 views
Skip to first unread message

ykt

unread,
Mar 2, 2010, 12:04:58 AM3/2/10
to CodeAndroid Malaysia
Hei All,
I am trying to build my android program used ant tool, i just followed
the tutorial in andoird site (quite straightforward).
But i got problem, once executing
`ant debug`
when during the 'Converting compiled files and external libraries
into ..' stage,
Error is
BUILD FAILED
/home/ykt/Lab/androidCamp/android-sdk-linux_86/platforms/android-2.1/
templates/android_rules.xml:261: The following error occurred while
executing this line:
/home/ykt/Lab/androidCamp/android-sdk-linux_86/platforms/android-2.1/
templates/android_rules.xml:125: Execute failed: java.io.IOException:
Cannot run program "/home/ykt/Lab/androidCamp/android-sdk-linux_86/
platforms/android-2.1/tools/dx": java.io.IOException: error=2, No such
file or directory

The last message of error is quite obvious, it said android-2.1/tools/
dx, not found.
Yes, it correct in my sdk directory i dont have that tool. I have the
latest sdk, but it seems it dx tools is not there.

So my question is anyone of have tried to build android project use
ant?
And could you check your android sdk directory, is there dx tools
found?
Thanks and Happy Coding,

Bernie Eng

unread,
Mar 2, 2010, 12:52:29 AM3/2/10
to codeandroi...@googlegroups.com
I have dx.jar in the tools folder. I'm on Linux btw.

Are you sure it's just looking for 'dx' and not 'dx.jar'? If that's the case, you may wanna try changing build.xml so that it points to 'dx.jar'. 

I can't really help because I tend to build projects using Eclipse, but I'll try Ant next time I build.

What version of the SDK are you on? I can mail the jar file to you if you let me know.

ykt

unread,
Mar 2, 2010, 1:19:22 AM3/2/10
to CodeAndroid Malaysia
I dont have dx.jar either,
I think it is 'dx', it based on the error message it says
"android-sdk-linux_86/platforms/android-2.1/tools/dx" not such file or
directory.

$ ls tools
NOTICE.txt* dmtracedump* layoutopt* traceview*
adb* draw9patch* lib/ zipalign*
android* emulator* mksdcard*
apkbuilder* hierarchyviewer* source.properties*
ddms* hprof-conv* sqlite3*

these all my tools in my sdk directory, i think i missed aapt too.
I downloaded the sdk from here http://developer.android.com/sdk/index.html
(latest sdk 2.1).

Sure, it will be great if i just tried your dx.jar, just try an
error :).

FIY, i am using freebsd, I dont installed any IDE on this laptop.

Thanks for the responds.

Bernie Eng

unread,
Mar 2, 2010, 1:25:13 AM3/2/10
to codeandroi...@googlegroups.com
I just checked again, and I actually do have a file called dx. Question: are you listing the tools folder that is outside of the platform folder? That's not right.  I only have these in the platform/tools folder:

aapt*  aidl*  dexdump*  dx*  lib/  NOTICE.txt

Yasir Khalid

unread,
Mar 2, 2010, 1:33:08 AM3/2/10
to codeandroi...@googlegroups.com

Yes, I listed outside of platform folder, I think I got the 'hint' already, let me try to configure back the path, I think ant is looking to wrong path.
Thanks ,

On Mar 2, 2010 6:25 AM, "Bernie Eng" <ebe...@gmail.com> wrote:

I just checked again, and I actually do have a file called dx. Question: are you listing the tools folder that is outside of the platform folder? That's not right.  I only have these in the platform/tools folder:

aapt*  aidl*  dexdump*  dx*  lib/  NOTICE.txt



On Tue, Mar 2, 2010 at 2:19 PM, ykt <y.k.t...@gmail.com> wrote:
>
> I dont have dx.jar either,

Yasir Khalid

unread,
Mar 2, 2010, 1:56:53 AM3/2/10
to codeandroi...@googlegroups.com
Hei,
I got workaround, it found that dx script tool need bash shell.
And i dont installed bash (i use tcsh), so i just simple edit #/bin/bash to #/bin/sh (in dx).
I know bash and sh have different syntax,  since installing bash  is my last option,  so i just blindly edit the dx file,
then it works, lucky me the dx script can be run under sh program.
$ant debug
...
BUILD SUCCESSFUL
Total time: 4 seconds

Thanks for the respond.
--
- Yasir -

Bernie Eng

unread,
Mar 2, 2010, 1:59:21 AM3/2/10
to codeandroi...@googlegroups.com

LOL good then. Wouldn't have guessed it's due to a missing shell.

On Mar 2, 2010 2:56 PM, "Yasir Khalid" <y.k.t...@gmail.com> wrote:

Hei,
I got workaround, it found that dx script tool need bash shell.
And i dont installed bash (i use tcsh), so i just simple edit #/bin/bash to #/bin/sh (in dx).
I know bash and sh have different syntax,  since installing bash  is my last option,  so i just blindly edit the dx file,
then it works, lucky me the dx script can be run under sh program.
$ant debug
...
BUILD SUCCESSFUL
Total time: 4 seconds

Thanks for the respond.




On Tue, Mar 2, 2010 at 2:33 PM, Yasir Khalid <y.k.t...@gmail.com> wrote:
>

> Yes, I listed outs...

--
- Yasir -

Reply all
Reply to author
Forward
0 new messages