任务':app:transformResourcesWithMergeJavaResForDebug'的执行失败。 >
问题描述:
当我尝试编译这个库 'org.brunocvcunha.instagram4j:instagram4j:1.5' 我得到任务':app:transformResourcesWithMergeJavaResForDebug'的执行失败。 >
执行失败的任务 ':应用程序:transformResourcesWithMergeJavaResForDebug'。 >发现多个文件与操作系统无关的路径'log4j.properties'
任何想法如何解决这个问题?我创建了一个新项目来测试这个库,所以这是我尝试编译的第一个库。
我已经通过互联网搜索,只有我发现这个错误的是要补充一点:
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
但是,这并不帮助。任何想法如何解决这个错误?提前致谢。
答
您可以尝试排除log4j.properties这个:
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'log4j.properties'
// or use:
// exclude 'path/of/log4j/log4j.properties'
}
或者,你可以尝试从以下行的依赖性不包括log4j的:
dependencies {
...
compile ('org.brunocvcunha.instagram4j:instagram4j:1.5') {
exclude group: "log4j", module: "log4j"
}
}