I am trying to build an apk for my app in React Native but when I run ./gradlew assembleRelease at the end I got this error.
I don't even have an idea why this is happening.
Is there anyone that could help?
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/facebook/infer/annotation/Assertions.class
My dependencies:
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
}
I had the same problem and this might be because of the different version of the react-native dependency so I had changed it to fixed version.
compile ("com.facebook.react:react-native:0.55.0") { force = true }
And had changed all native library react-native version to the same as in my build.gradle
(app) that is 0.55.0 or whatever you are using but should have to be same in throughout the application.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.