【发布时间】:2016-11-15 06:35:07
【问题描述】:
我的 react-native 应用程序使用 react-native-fcm 和 react-native-maps,它在调试时运行良好,但在 assembleRelease 时失败
FAILURE:构建失败并出现异常。
- 出了什么问题:
任务“:app:transformClassesWithJarMergingForRelease”执行失败。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com/google/android/gms/common/api/zza.class
我的安卓/app/build.gradle
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
multiDexEnabled true
}
dependencies {
compile project(':react-native-maps')
compile project(':react-native-fcm')
compile project(':react-native-camera')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
和 android/build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
}
}
请提供任何解决方案。
【问题讨论】:
-
react-native-fcm 和 react-native-maps 都使用 play-service 9.4.0 我尝试添加 compile 'com.google.android.gms:play-services-maps:9.4.0 ' 到依赖项,但它不起作用:(
标签: react-native