clojure-android / lein-droid

A Leiningen plugin for building Clojure/Android projects
Eclipse Public License 1.0
645 stars 56 forks source link

0.2.0-preview1: DEX does not terminate #60

Closed ghost closed 10 years ago

ghost commented 10 years ago

Using 0.2.0-preview1 lein droid doall hangs during the DEX task. I see the CPU load go up briefly and then all DEX threads hang at 0% usage.

This works fine with 0.2.0-beta3, however DEBUG=1 shows no difference in command line parameters except for the added support libs (v4 and v13) ...

ghost commented 10 years ago

Apparently it only happens when including v4 AND v13 ... which in hindsight does not make that much sense.

alexander-yakushev commented 10 years ago

The only relevant difference between beta3 and preview1 is that I added support libraries on the dexer JAR path. Your latest observation confirms that it is the case. So, if you copy/paste the command that you see with DEBUG=1 and run it, the DEXer won't terminate either? If so, then I don't think I know what to do about it, apparently those two support libraries and Clojure doesn't combine well for some reason.

Now I looked into v13.jar and it seems to contain all the classes from v4... Can you try just running for v13 and see if that is enough for your application? DEX is known for hating same duplicate classes...

ghost commented 10 years ago

yes, that's just what I did and that fixes things also with preview1. However some sort of warning would be good, because the configuration does allow the v4 & v13 combination, so it's easy to make the mistake.

alexander-yakushev commented 10 years ago

I'd like to put a warning, but seems like I'll have to hardcode it. I wonder, can you add two support libraries using ADT/Eclipse, and will it signalize any kind of error?

ghost commented 10 years ago

In this particular case (v4 && v13), yes, there will be a warning, and v4 will be ignored.

This behavior is hardcoded in JarListSanitizer.java in the SDK, so a hardcoded check in lein-droid would at least not be uglier than the original toolchain ;-)

alexander-yakushev commented 10 years ago

I hope this one will do.