Android build works in Eclipse but not with Ant ("already added") -
my android project uses several git submodules marked android libraries. these submodules have different uses of ormlite android jars , have ormlite jars included in libs
directory. eclipse handles situation correctly: includes ormlite jars once during dex
processing , generates valid .apk, when run build via ant debug
, get:
[echo] converting compiled files , external libraries /home/webedit/.hudson/jobs/xyz/workspace/bin/classes.dex... [apply] [apply] unexpected top-level exception: [apply] java.lang.illegalargumentexception: added: lcom/j256/ormlite/android/androidcompiledstatement; [apply] @ com.android.dx.dex.file.classdefssection.add(classdefssection.java:123) [apply] @ com.android.dx.dex.file.dexfile.add(dexfile.java:143) [apply] @ com.android.dx.command.dexer.main.processclass(main.java:338) [apply] @ com.android.dx.command.dexer.main.processfilebytes(main.java:315) [apply] @ com.android.dx.command.dexer.main.access$100(main.java:56) [apply] @ com.android.dx.command.dexer.main$1.processfilebytes(main.java:266) [apply] @ com.android.dx.cf.direct.classpathopener.processarchive(classpathopener.java:244) [apply] @ com.android.dx.cf.direct.classpathopener.processone(classpathopener.java:130) [apply] @ com.android.dx.cf.direct.classpathopener.process(classpathopener.java:108) [apply] @ com.android.dx.command.dexer.main.processone(main.java:284) [apply] @ com.android.dx.command.dexer.main.processallfiles(main.java:220) [apply] @ com.android.dx.command.dexer.main.run(main.java:176) [apply] @ com.android.dx.command.dexer.main.main(main.java:157) [apply] @ com.android.dx.command.main.main(main.java:89)
is there way have multiple copies of same jar sprinkled across multiple libraries? there ant build setting can change work?
i got same problem using maven because correctly added ormlite-core-jarfile, contains packages , classes core-jar few additional classes.
i added exclusion , works
<dependency> <groupid>com.j256.ormlite</groupid> <artifactid>ormlite-android</artifactid> <version>4.9</version> <exclusions> <exclusion> <groupid>com.j256.ormlite</groupid> <artifactid>ormlite-core</artifactid> </exclusion> </exclusions> </dependency>
Comments
Post a Comment