Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Android Build Failure

I'm currently having this error when I build my react native project using android studio. How do I fix this and remove the duplicates.

 Duplicate class com.facebook.imagepipeline.cache.CountingMemoryCacheInspector found in modules imagepipeline-base-2.2.0-runtime.jar (com.facebook.fresco:imagepipeline-base:2.2.0) and stetho-2.0.0-runtime.jar (com.facebook.fresco:stetho:2.0.0)
    Duplicate class com.facebook.imagepipeline.cache.CountingMemoryCacheInspector$DumpInfo found in modules imagepipeline-base-2.2.0-runtime.jar (com.facebook.fresco:imagepipeline-base:2.2.0) and stetho-2.0.0-runtime.jar (com.facebook.fresco:stetho:2.0.0)
    Duplicate class com.facebook.imagepipeline.cache.CountingMemoryCacheInspector$DumpInfoEntry found in modules imagepipeline-base-2.2.0-runtime.jar (com.facebook.fresco:imagepipeline-base:2.2.0) and stetho-2.0.0-runtime.jar (com.facebook.fresco:stetho:2.0.0)
like image 250
forests Avatar asked Jun 09 '26 21:06

forests


2 Answers

I had a similar error when I upgraded my React Native project to 0.68.2.

Solved this by updating the Flipper SDK version. The flipper version was 0.33.1 and changed it to 0.99.0.

Credits

like image 124
Mahendra Liya Avatar answered Jun 12 '26 11:06

Mahendra Liya


This seems to be caused by conflicts between Flipper and Fresco. Add this to the app level build.gradle:

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
    exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
    exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
    exclude group:'com.facebook.fbjni'
    exclude group:'com.facebook.fresco'
}

(FLIPPER_VERSION is defined in gradle.properties as 0.33.1)

like image 41
Thijs Avatar answered Jun 12 '26 10:06

Thijs



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!