簡體   English   中英

React Native Android 構建失敗

[英]React Native Android Build Failure

當我使用 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)

這似乎是由 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)

我有同樣的錯誤。 package.json中刪除以下代碼,依賴項對我有用:

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

我不太確定為什么,但也許是因為那是重復的地方。

當我將我的 React Native 項目升級到0.68.2時,我遇到了類似的錯誤。

通過更新 Flipper SDK 版本解決了這個問題。 腳蹼版本是0.33.1並將其更改為0.99.0

學分

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM