出了什么问题:任务':app:transformClassesWithJarMergingForRelease'.的执行失败
com.android.build.api.transform.TransformException: java.util.zip.ZipException:重复条目: com/google/android/gms/internal/measurement/zzwn.class
我试图创建一个任务来删除一个副本,但没有成功。
这项任务:
task findDuplicates {
doLast {
def findMe = 'com/google/android/gms/internal/measurement/zzwn.class'
configurations.compile.asFileTree.matching {
include '**/*.jar'
}.files.each { File jarFile ->
zipTree(jarFile).visit { FileVisitDetails fvd ->
if (fvd.path == findMe) {
println "Found $findMe in $jarFile.name"
}
}
}
}
}我的依赖关系:
dependencies {
compile project(':react-native-fast-image')
compile project(':react-native-facebook-login')
compile project(':realm')
compile project(':react-native-sqlite-storage')
compile project(':react-native-device-info')
compile project(':react-native-splash-screen')
compile project(':react-native-vkontakte-login')
compile project(':react-native-google-analytics-bridge')
compile project(':react-native-custom-tabs')
compile project(':react-native-onesignal')
compile project(':react-native-fabric')
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.facebook.react:react-native:+' // From node_modules
compile 'com.facebook.fresco:animated-gif:1.9.0'
compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
transitive = true;
}
}发布于 2018-08-10 06:40:49
我发现react-native-google-analytics-bridge和react-native-onesignal之间存在冲突,我在app/build.gradle中添加了dependencie compile 'com.google.firebase:firebase-messaging:17.1.0'。
我希望这会对某人有所帮助。
https://stackoverflow.com/questions/51772980
复制相似问题