gpt4 book ai didi

android - 带有Multidex的Android Studio中的DOCX4J提供了重复的库输入错误

转载 作者:行者123 更新时间:2023-12-03 04:38:22 24 4
gpt4 key购买 nike

我试图在这里获取docx4j的所有库:
https://stackoverflow.com/a/23710079/1616685

我成功设置了MultiDex,但是出现重复的输入错误:

Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: org/apache/harmony/awt/internal/nls/Messages.class

如您所见,有很多库可以编译...很容易产生重复,是否有办法避免这种错误?

这里的gradle:
apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.example.test_images"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}


packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
}
dexOptions {
preDexLibraries = false
// incremental true
javaMaxHeapSize "4g"
incremental true
}
productFlavors {
}
compileOptions {
}
}

subprojects {
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = false
} else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = false
}
}
}
afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = ['--multi-dex']
} else {
dx.additionalParameters += '--multi-dex'
}
}
}

dependencies {
compile ('com.android.support:multidex:1.0.0'){ exclude group: 'java.util.zip' }
compile ('com.android.support:appcompat-v7:22.2.0')
compile ('com.parse.bolts:bolts-android:1.+')
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/ae-awt.jar')
compile files('libs/ae-docx4j-2.8.0-SNAPSHOT.jar')
compile files('libs/ae-jaxb-2.2.5.jar')
compile files('libs/ae-xmlgraphics-commons.jar')
compile files('libs/avalon-framework-api-4.3.1.jar')
compile files('libs/avalon-framework-impl-4.3.1.jar')
compile files('libs/commons-codec-1.3.jar')
compile files('libs/commons-io-1.3.1.jar')
compile files('libs/commons-lang-2.4.jar')
compile files('libs/commons-logging-1.1.1.jar')
compile files('libs/droidText.0.4.jar')
compile files('libs/istack-commons-runtime.jar')
compile files('libs/JAXBNamespacePrefixMapper-2.2.4.jar')
compile files('libs/jaxp-datatype.jar')
compile files('libs/log4j-1.2.15.jar')
compile files('libs/serializer-2.7.1.jar')
compile files('libs/stringtemplate-3.2.1.jar')
compile files('libs/txw2-20110809.jar')
compile files('libs/w3c-css.jar')
// compile 'com.android.support:support-annotations:22.2.0'
// compile 'com.android.support:multidex:1.0.0'
}

最佳答案

https://github.com/plutext/Docx4j4Android4/是一个Android Studio项目;它使用Maven阴影插件重新打包org.apache.http

关于android - 带有Multidex的Android Studio中的DOCX4J提供了重复的库输入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31322854/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com