android - ZipException : duplicate entry: com/google/android/gms/internal/measurement/zzwn. 类

标签 android react-native

出了什么问题: 任务“:app:transformClassesWithJarMergingForRelease”执行失败。

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: 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;
    }
}

最佳答案

我发现 react-native-google-analytics-bridgereact-native-onesignal 之间存在冲突,我添加了依赖项 compile 'com.google.firebase :firebase-messaging:17.1.0'app/build.gradle 中。

我希望这会对某人有所帮助。

关于android - ZipException : duplicate entry: com/google/android/gms/internal/measurement/zzwn. 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51772980/

相关文章:

android - Android 的 token 模式

javascript - 检查 Jest 和 enzyme 中的按钮文本

objective-c - react native 深度链接与 Facebook SDK 冲突

listview - 如何在 MobX 中使用 React Native ListView?

android - 与 SlidingUpPanel 中的 ViewPager 交互

android - 如何在 Android 中使用这个库?

Android Studio 1.1.0 Facebook SDK 登录

android - 使用 Android 进行预处理

react-native - 如何使用 async/await 通过使用函数从 AsyncStorage 中检索值以响应 native

node.js - 有关如何为聊天应用程序设计良好架构的建议?