错误:Android Dex:com.android.dex.DexException:多个dex文件定义Lcom / sinovoice / hcicloudsdk / recorder / ASRCommonRecorder;

时间:2015-03-26 06:59:25

标签: android

我正在使用Android Studio 1.0。我试图将我的项目从eclipse移植到android,这不是gradle-built,但是它会不断出现这个错误。我做了一些关于这类问题的搜索,发现有两个依赖库项目使用相同的support-v4.jar,我已经删除了其中一个,但仍然出现了这个错误,这里是错误日志。有人可以帮忙吗?

  

错误:Android Dex:[duoduo_passenger_4.0]   com.android.dex.DexException:多个dex文件定义   LCOM /华声/ hcicloudsdk /记录器/ ASRCommonRecorder;错误:安卓   Dex:[duoduo_passenger_4.0] at   com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)   错误:Android Dex:[duoduo_passenger_4.0] at   com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)   错误:Android Dex:[duoduo_passenger_4.0] at   com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)   错误:Android Dex:[duoduo_passenger_4.0] at   com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)   错误:Android Dex:[duoduo_passenger_4.0] at   com.android.dx.merge.DexMerger.merge(DexMerger.java:189)错误:Android   Dex:[duoduo_passenger_4.0] at   com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)   错误:Android Dex:[duoduo_passenger_4.0] at   com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)   错误:Android Dex:[duoduo_passenger_4.0] at   com.android.dx.command.dexer.Main.run(Main.java:246)错误:Android   Dex:[duoduo_passenger_4.0] at   sun.reflect.NativeMethodAccessorImpl.invoke0(原生方法)   错误:Android Dex:[duoduo_passenger_4.0] at   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)   错误:Android Dex:[duoduo_passenger_4.0] at   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)   错误:Android Dex:[duoduo_passenger_4.0] at   java.lang.reflect.Method.invoke(Method.java:606)错误:Android Dex:   [duoduo_passenger_4.0] at   org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:161)   错误:Android Dex:[duoduo_passenger_4.0] at   org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:294)   错误:Android Dex:[duoduo_passenger_4.0] at   com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)

1 个答案:

答案 0 :(得分:0)

我通过在android块中的build.gradle文件中添加以下代码来解决类似的错误。

 dexOptions {
     preDexLibraries = false
 }