我的Android項目使用幾個標記爲Android庫的git子模塊。這些子模塊都具有ORMlite Android JAR的不同用途,因此在其libs
目錄中包含ORMlite罐。 Eclipse的正確處理這樣的情況:它dex
加工過程中包括一旦ORMlite罐子,併產生一個有效的apk文件,但是當我通過ant debug
運行構建,我得到:Android構建在Eclipse中工作,但不與Ant(「已添加」)
[echo] Converting compiled files and external libraries into /home/webedit/.hudson/jobs/xyz/workspace/bin/classes.dex...
[apply]
[apply] UNEXPECTED TOP-LEVEL EXCEPTION:
[apply] java.lang.IllegalArgumentException: already added: Lcom/j256/ormlite/android/AndroidCompiledStatement;
[apply] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[apply] at com.android.dx.dex.file.DexFile.add(DexFile.java:143)
[apply] at com.android.dx.command.dexer.Main.processClass(Main.java:338)
[apply] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:315)
[apply] at com.android.dx.command.dexer.Main.access$100(Main.java:56)
[apply] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:266)
[apply] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
[apply] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
[apply] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
[apply] at com.android.dx.command.dexer.Main.processOne(Main.java:284)
[apply] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:220)
[apply] at com.android.dx.command.dexer.Main.run(Main.java:176)
[apply] at com.android.dx.command.dexer.Main.main(Main.java:157)
[apply] at com.android.dx.command.Main.main(Main.java:89)
有什麼辦法有多個副本同一個JAR分佈在多個庫上?是否有可以改變的Ant構建設置以使其起作用?
我的錯誤是:已添加:LCOM/j256/ormlite /刀/ BaseDaoImpl $ 1 – cproinger 2012-01-15 21:54:37
這就是我一直在尋找:)謝謝! – 2012-07-10 18:58:56
ormlite的新當前版本似乎不會遇到這個問題 – cproinger 2012-07-15 16:04:25