从 59.5 升级到 60.4 时,React Native 版本不匹配



按照 https://react-native-community.github.io/upgrade-helper/上的所有说明升级到较新版本的 react native (60.4( 后 但仍然收到此错误消息:

console.error: "React Native version mismatch.
JavaScript version: 0.57.8
Native version: 0.60.4
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'.

这是截图 关键是我在升级之前使用的是 0.59.5 版。

已经尝试过:

- Downgrading to 60.0
- Removing node_modules/
- Removing react-navigation (maybe it was using another version of RN, but it is on version 3.11.1 now)
- Another develop environment
- Deleting entire folder and cloning from remote
- implementation ("com.facebook.react:react-native:0.60.4") { force = true }

这是我package.json依赖项:

"dependencies": {
"@react-native-community/async-storage": "^1.6.1",
"native-base": "^2.13.4",
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-animatable": "^1.3.0",
"react-native-camera": "^3.0.1",
"react-native-firebase": "^5.5.6",
"react-native-gesture-handler": "^1.3.0",
"react-native-masked-text": "^1.12.5",
"react-native-material-menu": "^0.6.6",
"react-native-push-notification": "^3.1.8",
"react-native-qrcode-scanner": "^1.2.1",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "3.11.1"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/plugin-transform-runtime": "^7.5.5",
"@babel/runtime": "^7.5.5",
"@react-native-community/eslint-config": "^0.0.5",
"babel-eslint": "^10.0.2",
"babel-jest": "^24.8.0",
"documentation": "12.1.1",
"eslint": "^6.1.0",
"eslint-config-airbnb-base": "^13.2.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-native": "^3.7.0",
"flow-bin": "^0.98.0",
"jest": "^24.8.0",
"jetifier": "^1.6.3",
"metro-react-native-babel-preset": "^0.55.0",
"react-test-renderer": "16.8.6"
},
  • 节点版本:12.8.0
  • 纱线版本:1.17.3

尝试watchman watch-del-all && react-native start --reset-cache后我能够运行,但所有矢量图标都崩溃了,所有 firebase 分析事件都导致应用程序崩溃。

解决方案是使用react-native init MyProject创建一个项目,他们在package.json中添加库,但react-native-vector-icons仍然需要链接。

唯一的问题是自定义字体根本不起作用!

相关内容

  • 没有找到相关文章

最新更新