【问题标题】:How to add firebase ml kit in react native如何在 React Native 中添加 firebase ml 套件
【发布时间】:2020-07-15 06:33:28
【问题描述】:

目前我在 react native 项目中使用 firebase

"react-native-firebase": "5.6.0", in package.json file

我使用 firebase ml 套件

yarn add @react-native-firebase/app
yarn add @react-native-firebase/ml-vision

我如上所述安装了 react-native-firebase/app。

"@react-native-firebase/app": "8.2.0",
"@react-native-firebase/ml-vision": "7.2.2",
"react-native-firebase": "5.6.0" in package.json file

这样使用时会出现如下错误 我认为firebase正在崩溃 有没有办法解决这个问题? 感谢阅读

* What went wrong:
Execution failed for task':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
  Program type already present: io.invertase.firebase.BuildConfig
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.

【问题讨论】:

    标签: react-native firebase-mlkit


    【解决方案1】:

    您似乎正在尝试将旧版本的 React Native Firebase ("react-native-firebase": "5.6.0") 与新版本的 React Native Firebase ("@react-native-firebase/app": "8.2.0",) 混合在一起

    这些都是 React Native Firebase 的完全不同的实现,不应该混用; react-native-firebase 是一种旧实现,已近 2 年没有得到支持。您尝试混合它们有什么原因吗?

    @react-native-firebase/* 开头的包是正确的。

    我建议关注这些文档;

    如果您对 React Native Firebase 有任何其他问题,我建议您在项目的 GitHub 存储库here 上提出问题,因为这是项目的主要支持渠道。

    【讨论】:

      猜你喜欢
      • 2022-01-15
      • 2021-12-10
      • 1970-01-01
      • 1970-01-01
      • 2015-07-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-23
      相关资源
      最近更新 更多