title: Two Android libraries duplicate the same jar - Ant build error
body: <p>I have a project that uses two independent Android libraries. Each of them contains Android support package, so that ant build fails on 'dex' step:</p>
  
  <pre><code>   [dx] UNEXPECTED TOP-LEVEL EXCEPTION:
     [dx] java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
     [dx]     at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
     [dx]     at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
     [dx]     at com.android.dx.command.dexer.Main.processClass(Main.java:486)
     [dx]     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
     [dx]     at com.android.dx.command.dexer.Main.access$400(Main.java:67)
     [dx]     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
     [dx]     at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
     [dx]     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
     [dx]     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
     [dx]     at com.android.dx.command.dexer.Main.processOne(Main.java:418)
     [dx]     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
     [dx]     at com.android.dx.command.dexer.Main.run(Main.java:206)
     [dx]     at com.android.dx.command.dexer.Main.main(Main.java:174)
     [dx]     at com.android.dx.command.Main.main(Main.java:95)
     [dx] 1 error; aborting
  </code></pre>
  
  <p>What should I do? </p>
  
  <p>I'm going to move one of these jar files out of the libs folder in <strong>-post-compile</strong> target. And then move it back after dex step is finished.
  What are your recommendations?</p>
  
  <p><strong>UPDATE:</strong>
  I've tried to move the support package out of one the libraries in <strong>-post-compile</strong> target but it still fails because of another reason. This jar is already included to the path that is processed by dex task. And dex task cannot open the removed jar.</p>