Skip to content Skip to sidebar Skip to footer

Gradle: Cant Exclude One Of Two Log4j Dependencies?

Occuring error While trying to build an android studio project with gradle i recieve this error: Execution failed for task ':app:transformResourcesWithMergeJavaResForPlainDebug'. c

Solution 1:

I have no idea what tn5250j.jar is but it looks like it's an UBER jar which is packing log4j inside. You could either exclude the log4j dependency from your build (since it's packed inside tn5250j.jar) or you tweak tn5250j.jar to remove log4jand use the "tweaked" jar instead. Eg:

dependencies {
    ...
    compile files("$buildDir/tweaked/tn5250j-tweaked.jar")
}
task tweakTn5250j(type: Zip) {
    from zipTree('libs/tn5250j.jar').matching {
        exclude 'org/apache/log4j/**'
    }
    destinationDir = "$buildDir/tweaked"
    archiveName = 'tn5250j-tweaked.jar'
}
classes.dependsOn tweakTn5250j

Post a Comment for "Gradle: Cant Exclude One Of Two Log4j Dependencies?"