我正在开发一个关于本机反应的项目,并且一天前工作的相同代码不再有效。这是我的build.gradle依赖项:
compile project(':react-native-audio')
compile project(':react-native-fcm')
compile project(':bugsnag-react-native')
compile project(':react-native-code-push')
compile project(':react-native-mixpanel')
compile project(':react-native-vector-icons')
compile project(':react-native-permissions')
compile project(':react-native-maps')
compile project(':react-native-device-info')
compile fileTree(dir: "libs", include: ["*.jar"])
compile ('com.google.firebase:firebase-core:10.2.1') {
force = true;
}
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+"
compile 'com.android.support:multidex:1.0.0'
compile ('com.google.android.gms:play-services-gcm:10.2.1') {
force = true;
}
compile ("com.google.android.gms:play-services-maps:10.2.1") {
force = true;
}
compile project(':react-native-mauron85-background-geolocation')
compile 'com.facebook.fresco:animated-base-support:0.11.0'
compile 'com.facebook.fresco:animated-gif:0.13.0'
compile 'com.facebook.fresco:animated-webp:0.11.0'
compile 'com.facebook.fresco:webpsupport:0.11.0'
compile 'com.facebook.fresco:webpsupport:0.11.0'
如果我对任何依赖项出错,请告诉我。
以下是完整错误:
:app:transformClassesWithJarMergingForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/iid/zzc.class
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 17.05 secs
提前致谢!
答案 0 :(得分:1)
com.google.android.gms:play-services-maps
是重复的,因为它已经包含在react-native-maps
中,版本不同。
您可以安全地将其删除。
答案 1 :(得分:1)
想出来。 Google Play服务版本与依赖项之间存在不匹配。升级了所有最新价值的东西,现在工作正常。
答案 2 :(得分:0)
在图书馆react-native-maps
和com.google.android.gms:play-services-maps
中,它们是广告类,因此您必须在android gradle中排除zzc.class