我正在写一个简单的游戏。现在我收到一个错误:
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
D:\Users\usr\AppData\Local\Android\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output D:\AndroidStudioProjects\AndEn2\app\build\intermediates\dex\debug --input-list=D:\AndroidStudioProjects\AndEn2\app\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/andengine/BuildConfig;
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:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
这里的inputList.txt:
D:\AndroidStudioProjects\AndEn2\app\build\intermediates\classes\debug
D:\AndroidStudioProjects\AndEn2\app\build\intermediates\pre-dexed\debug\support-annotations-21.0.3-9a10cbc22274e2e8fc138014c758289ff1502786.jar
D:\AndroidStudioProjects\AndEn2\app\build\intermediates\pre-dexed\debug\classes-7cdd0c2076c1614f90cf8045e7d9a9e6f846ce50.jar
D:\AndroidStudioProjects\AndEn2\app\build\intermediates\pre-dexed\debug\internal_impl-21.0.3-c5c4b9594048547d5aaed49283c5f6a71a027329.jar
D:\AndroidStudioProjects\AndEn2\app\build\intermediates\pre-dexed\debug\classes-cfe53c610abb0d3fb855285218623ad39e5654d4.jar
D:\AndroidStudioProjects\AndEn2\app\build\intermediates\pre-dexed\debug\classes-e6aeb9ef541a00de85cb2dda6081ffebd232a0c0.jar
D:\AndroidStudioProjects\AndEn2\app\build\intermediates\pre-dexed\debug\classes-501f5879b0b025640bc837772b77aaf2ce8c14e5.jar
我在root下有2个andEngine文件夹(AndEn2> andEngine,AndEn2>和Enginebox2d)。如果我删除andEnginebox2d,我可以运行我的游戏。