【问题标题】:React Native Android Build FailureReact Native Android 构建失败
【发布时间】:2020-06-21 20:24:11
【问题描述】:

当我使用 android studio 构建我的 react 本机项目时,我目前遇到了这个错误。如何解决此问题并删除重复项。

 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)

【问题讨论】:

标签: android react-native android-studio react-native-android


【解决方案1】:

我有同样的错误。从 package.json 中删除以下代码对我有用:

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

我不太确定为什么,但可能是因为那是重复的地方。

【讨论】:

  • 当然!很高兴我能帮上忙。
【解决方案2】:

这似乎是由 Flipper 和 Fresco 之间的冲突引起的。将此添加到应用级别的 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 在 gradle.properties 中定义为 0.33.1)

【讨论】:

  • 这个解决方案没有解决我的问题。事实上,在这之后我遇到了很多问题。有什么替代建议吗?
猜你喜欢
  • 2018-03-08
  • 2019-03-21
  • 2020-08-12
  • 2016-07-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-01-07
  • 1970-01-01
相关资源
最近更新 更多