React 原生版本不匹配 js 版本 0.50.4 原生版本 0.62.2



我是 React Native 的新手,正在处理一个旧项目,得到此错误在过去几个小时内无法解决它,有人请帮助吗?

JavaScript版本:0.50.4 本机版本:0.62.2

确保已重新生成本机代码。如果问题仍然存在,请尝试使用watchman watch-del-all && react-native start --reset-cache清除守望者和打包程序缓存。

这就是我的package.json的样子

{
"name": "WhoopaUserApp",
"version": "0.1.0",
"private": true,
"devDependencies": {
"@babel/core": "^7.8.6",
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/plugin-transform-runtime": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"babel-preset-expo": "~8.1.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"jest-expo": "^37.0.0",
"react-native-clean-project": "^3.3.0",
"react-native-cli": "^2.0.1",
"react-test-renderer": "16.0.0-alpha.12",
"redux-logger": "^3.0.6"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"rnpm": {
"assets": [
"./src/assets/fonts/"
]
},
"dependencies": {
"@sentry/react-native": "^1.4.1",
"ac-qrcode": "^1.0.1",
"babel-preset-react-native": "^4.0.1",
"errno": "^0.1.7",
"expo": "^37.0.3",
"fetchival": "^0.3.3",
"glob": "^7.1.6",
"immutability-helper": "^2.4.0",
"jsc-android": "^241213.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"normalizr": "^3.2.4",
"numeral": "^2.0.6",
"prop-types": "^15.6.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-native": "^0.61.4",
"react-native-cached-image": "^1.4.3",
"react-native-camera": "git+https://git@github.com/react-native-community/react-native-camera.git",
"react-native-config": "^0.10.0",
"react-native-easy-toast": "^1.1.0",
"react-native-fbsdk": "^0.6.3",
"react-native-fetch-blob": "^0.10.8",
"react-native-gesture-handler": "^1.6.1",
"react-native-google-signin": "^0.12.0",
"react-native-i18n": "^2.0.9",
"react-native-maps": "0.26.1",
"react-native-modal": "^4.0.0",
"react-native-orientation": "^3.1.0",
"react-native-popup-dialog": "^0.10.43",
"react-native-progress": "^3.4.0",
"react-native-reanimated": "~1.7.0",
"react-native-responsive-dimensions": "^1.0.2",
"react-native-router-flux": "^4.0.0-beta.24",
"react-native-screens": "~2.2.0",
"react-native-scrollable-tab-view": "^0.8.0",
"react-native-splash-screen": "3.0.6",
"react-native-swipe-list-view": "^1.0.4",
"react-native-swipe-out": "^2.0.14",
"react-native-swipeable": "^0.6.0",
"react-native-swipeview": "^1.0.3",
"react-native-swiping-row": "^0.1.2",
"react-native-update-js": "^1.0.8",
"react-native-vector-icons": "^6.6.0",
"react-native-web": "^0.12.2",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-persist": "^5.4.0",
"redux-saga": "^0.16.0",
"reselect": "^3.0.1"
}
}

经过几天的挣扎,我终于解决了。

  1. 第一次删除index.android.bundle(位于安卓项目下的"资产"文件夹中(
  2. 运行命令react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/(我将index.js替换为App.js(

最新更新