clojure-android / lein-droid

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

One library included twice #121

Closed yamafaktory closed 9 years ago

yamafaktory commented 9 years ago

Hi,

After multiples changes (even trying to remove dependencies back to a simple project.clj), I always get an error during the DEX generation:

java.lang.IllegalArgumentException: already added: Lclojure/tools/reader/impl/ExceptionInfo;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
    at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
    at com.android.dx.command.dexer.Main.processClass(Main.java:732)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
    at com.android.dx.command.dexer.Main.access$300(Main.java:83)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:632)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)

I also tried to clean and to remove everything in the target/debug directory, with no better result.

alexander-yakushev commented 9 years ago

lein-droid takes care of multiple versions of the same library, you might have an issue with unclean target dir. Try doing lein clean and then build again.

yamafaktory commented 9 years ago

Ok I tried it (thanks for your quick answer anyway!) but now the process complains about some not found symbols:

error: cannot find symbol
import android.webkit.ClientCertRequest;
                     ^
  symbol:   class ClientCertRequest
  location: package android.webkit

But the imports are correctly done in the mentioned java file (and it was working before). Maybe something related to a fresh install of android-studio...

alexander-yakushev commented 9 years ago

This usually happens when javac can't find Android SDK jars on the classpath. Try building with DEBUG=1 lein droid doall to see what your classpath contains.

By the way, it is often easier to reach me on #clojure-android at Freenode, if you use IRC.

yamafaktory commented 9 years ago

Ok, thanks a lot, I will investigate and eventually reach you on IRC!

alexander-yakushev commented 9 years ago

So, did you solve it?

yamafaktory commented 9 years ago

Yes, somehow switching from fish shell to bash did it (my ubuntu android-studio install/removal could be related to this - some env vars maybe). Now I am struggling with another error (instaparse via compojure).

alexander-yakushev commented 9 years ago

@yamafaktory I suggest you creating a separate issue for the instaparse problem, might be helpful for others that stumble upon it, until it is fixed.