React Native Generate Signed APK - :app:transformClassesWithJarMergingForRelease

问题描述 投票:0回答:1

我正在尝试为我的应用程序在React Native中构建一个apk但是当我运行时./gradlew assembleRelease最后我得到了这个错误。

我甚至都不知道为什么会这样。

有人可以提供帮助吗?

  • 出了什么问题:任务执行失败':app:transformClassesWithJarMergingForRelease'。 com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / facebook / infer / annotation / Assertions.class

我的依赖:

dependencies {
    compile project(':react-native-splash-screen')
    compile project(':react-native-linear-gradient')
    compile project(':react-native-svg')
    compile project(':react-native-vector-icons')
    compile project(':react-native-camera')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    compile "com.facebook.react:react-native:+"  // From node_modules
}
android react-native build apk gradlew
1个回答
0
投票

我有同样的问题,这可能是因为反应原生依赖的不同版本,所以我把它改为固定版本。

compile ("com.facebook.react:react-native:0.55.0") { force = true }

并且已将所有本机库react-native版本更改为与我的build.gradle(app)相同,即0.55.0或您使用的任何内容,但在整个应用程序中应该必须相同。

© www.soinside.com 2019 - 2024. All rights reserved.