我使用LeanCloud作为我的推送通知服务提供者,但是当我运行我的应用程序时,它给了我这个错误。下面是我的依赖关系:
dependencies {
compile 'com.android.support:multidex:1.0.1'
compile project(':react-native-push-notification')
compile project(':react-native-svg')
compile project(':react-native-fbsdk')
compile project(':react-native-picker')
compile project(':react-native-maps')
compile project(':react-native-wechat')
compile project(':react-native-code-push')
compile fileTree(dir: "libs", include: ["*.jar"])
compile ("com.android.support:appcompat-v7:23.0.1")
compile ("com.facebook.react:react-native:+") // From node_modules
compile ('com.facebook.android:facebook-android-sdk:[4.22.1)')
compile ('cn.leancloud.android:avoscloud-sdk:v4.4.4')
compile ('cn.leancloud.android:avoscloud-push:v4.4.4@aar'){
transitive = true
}
}准确的错误消息:
错误:任务':app:transformClassesWithJarMergingForDebug'.执行失败
com.android.build.api.transform.TransformException: java.util.zip.ZipException:重复条目:okhttp3 3/internal/ws/RealWebSocket$1.class
我试着添加“排除组:‘com.square up.okhttp 3’,模块:'okhttp'”。它允许我运行应用程序,但不知为何我无法在LeanCloud服务器上注册我的设备。
我在这个问题上陷得太久了。谢谢您的帮助或建议。
发布于 2017-09-26 06:33:05
您可以将其添加到app.gradle中。
configurations.all {
// OkHttp 3.5.0+ includes the websockets API, so we need this to prevent a conflict
exclude module: 'okhttp-ws'
}它可能对你有帮助!https://github.com/facebook/react-native/issues/12646
发布于 2020-05-21 14:00:54
加上下面的行,它可能对你有帮助,为我工作。
configurations.all { resolutionStrategy.force 'com.squareup.okhttp3:okhttp:3.4.1' }https://stackoverflow.com/questions/46178026
复制相似问题