1

I have a quite big eclipse project wich uses greenDAO and I want to import it to android studio.

I am running into quite a lot of trouble doing so. First using android studio import it included other projects and librarys related to mine but did not import dao. I than manually added greendao project wich found modules: DaoCore, DaoGenerator and DaoExampleGenerator I added dependency to the modules but I just get build error:

Error:Execution failed for task ':name:dexDebug'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Android\sdk\build-tools\21.1.1\dx.bat --dex --no-optimize --output path\build\intermediates\dex\debug --input-list=path\build\intermediates\tmp\dex\debug\inputList.txt Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lde/greenrobot/daogenerator/DaoGenerator; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171) at com.android.dx.merge.DexMerger.merge(DexMerger.java:189) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:302) at com.android.dx.command.dexer.Main.run(Main.java:245) at com.android.dx.command.dexer.Main.main(Main.java:214) at com.android.dx.command.Main.main(Main.java:106)

all three modules not found. And all includes in the java files of greendao are ignored.

I googled that you need to make some changes in gradle but that was for new projects not an big existing one.

Please help.

Tadej Vengust
  • 1,351
  • 4
  • 18
  • 35
  • In general your project has the symbol DoGenerator defined in multiple places, which you can't do in Android projects. That means the symbol is being defined redundantly in multiple libraries. I would suggest going through a process of adding the greenDAO dependencies one at a time to find the culprit. If you're still having problems, add your build files to your question. – Scott Barta Dec 02 '14 at 17:38

0 Answers0