【问题标题】:SQLite and react-nativeSQLite 和 react-native
【发布时间】:2020-02-28 18:59:49
【问题描述】:

我遇到了一个小问题,我想将 sqlite 与 react native 一起使用,我已经按照教程进行操作,但它们都没有运行。 例如本教程:https://github.com/andpor/react-native-sqlite-storage 当我必须将以下代码添加到 Podfile 时: pod 'React', :path => '../node_modules/react-native' pod 'react-native-sqlite-storage', :path => '../node_modules/react-native-sqlite-storage'

然后我转到 ios 文件,然后进行 pud 更新,我有这个: enter image description here

然后我继续按照教程进行操作: 我没有这个: enter image description here

但是这个: enter image description here

所以我需要帮助解决这些问题。 感谢您的帮助。

【问题讨论】:

    标签: sqlite react-native


    【解决方案1】:

    您在 podfile 中有重复的 react 依赖项。 删除这一行:

    pod 'React', :path => '../node_modules/react-native/'
    

    然后使用 pod update 重试。

    【讨论】:

    • 非常感谢,你解决了这个问题,但是你知道为什么我在xcode中打开我的项目文件时库中没有SQLite包吗?
    • 您是否运行了 pod update 和/或 pod install?根据说明,它应该足够了,之后您可以在 javascript 中使用该库。如果可以的话,我可以推荐使用 React Native >0.60,这样你就不必担心手动安装包。
    猜你喜欢
    • 2017-10-31
    • 2019-07-15
    • 2021-04-25
    • 2018-07-19
    • 2022-08-09
    • 2022-01-21
    • 2022-10-25
    • 2022-01-15
    • 2019-06-25
    相关资源
    最近更新 更多