8

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)
8
  • 1
    Can you try this one: github.com/facebook/flipper/issues/660#issuecomment-565119057 Commented Jun 21, 2020 at 22:06
  • I tried that suggestion but they seem to have a problem with flipper. My thing is having issues with fresco. I'm not sure how to remove the package in the correct format Commented Jun 22, 2020 at 3:16
  • Do you have a chance to downgrade to RN 0.61.5? Commented Jun 22, 2020 at 6:42
  • i downgraded RN to 0.61.5 but I still have the same error Commented Jun 22, 2020 at 15:17
  • Figured out this was an error with the Shoutem UI library. But don't know how to fix it. Posted a follow up question here stackoverflow.com/questions/62526519/… Commented Jun 23, 2020 at 2:54

3 Answers 3

8

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

Sign up to request clarification or add additional context in comments.

2 Comments

Worked for me on React Native 0.65
worked for me too updating to 0.65
6

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)

1 Comment

This solution didn't solve my issue. In fact, I got lot of issues after this. Any alternative suggestion?
4

I had the same error. Removing the following code from package.json the dependencies worked for me:

"react-native-photo-view": "github:shoutem/react-native-photo-view#0ffa1481f6b6cb8663cb291b7db1d6644440584d"

I'm not really sure why but maybe because that's where the duplication is.

1 Comment

sure! glad I could help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.