React Native Android 构建失败
React Native Android Build Failure
我目前在使用 android studio 构建我的 React Native 项目时遇到此错误。我该如何解决这个问题并删除重复项。
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)
我有同样的错误。从 package.json
依赖项中删除以下代码对我有用:
"react-native-photo-view": "github:shoutem/react-native-photo-view#0ffa1481f6b6cb8663cb291b7db1d6644440584d"
我不太确定为什么,但也许是因为那是重复的地方。
这好像是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)
我目前在使用 android studio 构建我的 React Native 项目时遇到此错误。我该如何解决这个问题并删除重复项。
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)
我有同样的错误。从 package.json
依赖项中删除以下代码对我有用:
"react-native-photo-view": "github:shoutem/react-native-photo-view#0ffa1481f6b6cb8663cb291b7db1d6644440584d"
我不太确定为什么,但也许是因为那是重复的地方。
这好像是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)