【问题标题】:React native version mismatch: native version: 0.61.5, javascript version: 0.57.7React 原生版本不匹配:原生版本:0.61.5,javascript 版本:0.57.7
【发布时间】:2020-01-11 07:44:35
【问题描述】:

我有一个不使用 expo 的 react-native 应用程序。我收到以下错误:

 React Native version mismatch.
                             │ 
                             │ JavaScript version: 0.57.7
                             │ Native version: 0.61.5
                             │ 
                             └ Make sure that you have rebuilt the native code. If the problem persists try clearing the Watchman and packager caches with `watchman watch-del-all && react-native start --reset-cache`.

我已经完成了this question中提到的所有事情 到目前为止没有任何效果。

我已将 react-native 版本更新为 0.61.5 。它已安装,并且在 package.json 中也提到了它。我还更新了 packages.json 中的所有包。

该项目还使用 react-navigation。在节点模块的@react-navigation 文件中,在native/package.json 文件中,"react-native": "^0.57.7" 是唯一在 devDependencies 下提到的地方。我已经安装了最新的 react-navigation,4.0.10

【问题讨论】:

    标签: android reactjs react-native react-navigation


    【解决方案1】:

    为了防止这个问题,你应该在android/app/build.gradle文件中强制使用React Native版本

    compile("com.facebook.react:react-native:0.61.5") { force = true }
    

    根据您的 react-native 版本更改 0.57.7。

    【讨论】:

    • 您最近升级了 Node.js 吗?你可以降级它,对我来说它有效。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-11-12
    • 1970-01-01
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多