当我将BoofCV集成到Android Studio中时,发生了以下错误,
com.androID.dex.DexException: Multiple dex files define Lorg/xmlpull/v1/XmlPullParser;
at com.androID.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
at com.androID.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
at com.androID.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
at com.androID.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.androID.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.androID.dx.command.dexer.Main.mergelibraryDexBuffers(Main.java:504)
at com.androID.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.androID.dx.command.dexer.Main.run(Main.java:277)
at com.androID.dx.command.dexer.Main.main(Main.java:245)
at com.androID.dx.command.Main.main(Main.java:106)
Error:Execution Failed for task ‘:app:dexDeBUG’.
com.androID.IDe.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/usr/lib/jvm/jdk1.8.0_60/bin/java” finished with non-zero exit value 2
我的build.gradle文件是
apply plugin: 'com.androID.application'androID {compileSdkVersion 23buildToolsversion "23.0.2"defaultConfig { applicationID "com.example.huayu.boofcvandroIDstart" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionname "1.0" //multIDexEnabled true}buildTypes { release { MinifyEnabled false proguardfiles getDefaultProguardfile('proguard-androID.txt'), 'proguard-rules.pro' }}}dependencIEs {compile filetree(dir: 'libs', include: ['*.jar'])testCompile 'junit:junit:4.12'compile 'com.androID.support:appcompat-v7:23.1.1'compile group: 'org.boofcv', name: 'all', version: '0.20'}
解决方法:
这是我处理问题的方式.像最初那样包括BoofCV罐子.然后将以下内容添加到您的app / build.gradle中
configurations { all*.exclude group: "xmlpull", module: "xmlpull"}
这将删除有问题的xmlpull.您可能还想包含androID模块,它不是’all’的一部分.
这是BoofAndroIDDemo上的示例
https://github.com/lessthanoptimal/BoofAndroidDemo/blob/master/app/build.gradle
总结以上是内存溢出为你收集整理的BoofCV gradle构建Android Studio中的错误全部内容,希望文章能够帮你解决BoofCV gradle构建Android Studio中的错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)