反应本机生成签名的APK-:app:transformClassesWithJarMergingForRelease

时间:2018-09-18 08:08:06

标签: android react-native build apk gradlew

我正在尝试在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
}

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,这可能是由于react-native依赖关系的版本不同,所以我将其更改为固定版本。

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

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

相关问题