title: Android multi dex project setup
body: <p>I am creating a multi-dex project setup by following this post: <a href="http://android-developers.blogspot.fr/2011/07/custom-class-loading-in-dalvik.html" rel="nofollow">http://android-developers.blogspot.fr/2011/07/custom-class-loading-in-dalvik.html</a></p>
  
  <p>Everything goes on successfully, and next, I'd like to separate the secondary dex into a library project.</p>
  
  <ol>
  <li><p>primary project contents:</p>
  
  <p>com.example.dex.*</p></li>
  <li><p>secondary (library) project contents:</p>
  
  <p>com.example.dex.lib.*</p></li>
  </ol>
  
  <p>However, I'm unable to share the com.example.dex.LibraryInterface which is required by both primary and library project.</p>
  
  <pre><code>UNEXPECTED TOP-LEVEL EXCEPTION:
  com.android.dex.DexException: Multiple dex files define Lcom/example/dex/Library
  Interface;
          at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
          at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
          at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
          at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
          at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
          at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:43)
  </code></pre>
  
  <p>Both project will need to reference the LibraryInterface, is there any way to share the class? Thanks!</p>