Possible dx task bug when using an empty external library fileset on Windows

35 views
Skip to first unread message

Charles Harley

unread,
Apr 3, 2009, 11:41:32 AM4/3/09
to Auto-android
This is actually two issues for me.

The first is that in my environment I have no external library files
that are referenced by my code (other then the Android SDK) and when
using the android:dx task it requires that a fileset is set for the
inputref attribute. To keep it happy I pass it an empty fileset.

The second issue occurs because of the first. When I run the build,
the dx task happily passes through the parameters to the dx.bat file
but because of the empty fileset it passes through a double quote
character as the last parameter. This is probably because of a fix for
a spaces in directories issue I reported a while back that has
resulted in parameters being quoted on Windows. The dx.jar tool then
thinks this last parameter is a file that needs to be compiled into
dex code. Obviously it throws a FileNotFoundException that looks
something like this:

[java] UNEXPECTED TOP-LEVEL EXCEPTION:
[java] java.lang.RuntimeException: : file not found
[java] at com.android.dx.util.FileUtils.readFile(FileUtils.java:
55)
[java] at com.android.dx.cf.direct.ClassPathOpener.processOne
(ClassPathOpener.java:133)
[java] at com.android.dx.cf.direct.ClassPathOpener.process
(ClassPathOpener.java:108)
[java] at com.android.dx.command.dexer.Main.processOne(Main.java:
245)
[java] at com.android.dx.command.dexer.Main.processAllFiles
(Main.java:183)
[java] at com.android.dx.command.dexer.Main.run(Main.java:139)
[java] at com.android.dx.command.dexer.Main.main(Main.java:120)
[java] at com.android.dx.command.Main.main(Main.java:87)
[java] 1 error; aborting

Notice that the missing file has no name, took a while to figure it
all out because I didn't know what file it was looking for. The end
result is that I made a simple one line change to the dx.java file on
line 16 to check for the additional arguments being empty and thus if
they are they won't be added to the list of parameters. This seemed to
fix the issue.

Charles

phil.h.smith

unread,
Apr 3, 2009, 12:52:03 PM4/3/09
to Auto-android
Hi, Charles

Thank you for the report: I've opened up http://code.google.com/p/autoandroid/issues/detail?id=10
and will see if I can't get it tonight.

Thanks!
--phil--

On Apr 3, 8:41 am, Charles Harley <charles.har...@googlemail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages