在我的android应用程序中,运行该应用程序时出现以下错误。我不确定该错误是什么意思。
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/log4j/Appender.class
我是否需要从依赖项配置中排除任何内容。我不确定重复输入的内容。 我也没有得到警告。
Warning:WARNING: Dependency commons-logging:commons-logging:1.2 is ignored for release as it may be conflicting with the internal version provided by Android.
以下是我的依赖项配置。
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.esp.office"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
lintOptions {
checkReleaseBuilds false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
dexOptions {
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.android.support:design:26.0.0'
compile 'com.android.support:cardview-v7:26.0.0'
compile 'com.android.support:recyclerview-v7:26.0.0'
compile 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
compile('org.springframework.android:spring-android-auth:2.0.0.M3') {
exclude module: 'spring-core'
}
compile 'org.springframework.android:spring-android-core:2.0.0.M3'
compile('org.springframework.boot:spring-boot-starter-web:1.5.2.RELEASE')
compile 'joda-time:joda-time:2.3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.0'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.0'
compile 'com.fasterxml.jackson.core:jackson-core:2.9.0'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.android.support:multidex:1.0.1'
compile 'net.sourceforge.jexcelapi:jxl:2.6.12'
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'com.github.ganfra:material-spinner:2.0.0'
compile 'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.14'
compile 'commons-io:commons-io:1.3.2'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
testCompile 'junit:junit:4.12'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.1.0'
}
}
}
}
build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
maven { url "https://jitpack.io" }
maven { url "https://repo.spring.io/libs-milestone" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
在gradle同步过程中未显示错误。只是当我尝试运行该应用程序而无法运行时。
可能是什么问题?