Android 渐变生成错误,错误:任务';的执行失败:应用程序:transformResourcesWithMergeJavaResForDebug';在pom.xml中
大家好,我在尝试运行android应用程序时遇到以下错误: 渐变生成错误,错误:任务执行失败“:app:transformResourcesWithMergeJavaResForDebug” com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:APK META/INF/maven/com.squareup.okio/okio/pom.xml中复制的重复文件 这是我的两个gradle文件:Android 渐变生成错误,错误:任务';的执行失败:应用程序:transformResourcesWithMergeJavaResForDebug';在pom.xml中,android,android-gradle-plugin,Android,Android Gradle Plugin,大家好,我在尝试运行android应用程序时遇到以下错误: 渐变生成错误,错误:任务执行失败“:app:transformResourcesWithMergeJavaResForDebug” com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException:APK META/INF/maven/com.squareup.okio/okio/pom.xml中
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
apply plugin: 'maven'
maven { url 'https://maven.google.com' }
maven {url 'https://maven.fabric.io/public'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是另一个:
请帮忙
android {
......
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'
}
}
添加此项以排除META-inf文件添加此
打包选项{exclude'META-inf/DEPENDENCIES'exclude'META-inf/NOTICE'exclude'META-inf/LICENSE'}
。希望这对你有帮助。谢谢兄弟。如果你愿意,你可以把这个作为答案,如果你愿意,我可以接受它作为正确的解决方案。问候语!谢谢,但这并没有解决问题。
android {
......
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'
}
}