在我初始化一个项目然后启动Xcode模拟器时获得以下消息:
"React Native version mismatch.
Javascript version: 0.59.10
Native version: 0.61.4-undefined
..."
我的package.json:
{
"name": "tinder-react-native",
"description": "Tinder React Native clone",
"version": "0.2.0",
"author": "Steven Persia",
"licence": "MIT",
"homepage": "https://github.com/stevenpersia/tinder-react-native",
"private": true,
"scripts": {
"lint": "eslint ./components ./containers --fix",
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"expo": "^37.0.8",
"react": "16.6.3",
"react-native": "^0.59.10",
"react-native-card-stack-swiper": "^1.1.0",
"react-native-gesture-handler": "^1.0.12",
"react-navigation": "^3.0.9"
},
"devDependencies": {
"babel-jest": "^24.8.0",
"eslint": "^6.6.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-native": "^3.8.1",
"eslint-plugin-standard": "^4.0.1",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native",
"transform": {
"node_modules/react-native/.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
}
},
"rnpm": {
"assets": [
"./assets/fonts/"
]
}
}
我的app.json(它没有sdkVersion):
{
"name": "tinderReact",
}
有人知道这里发生了什么并且可以帮助我吗?这实在令人沮丧。 一些信息:我没有安装守卫。我不知道该怎么办,因为app.json开头没有sdkVersion。
答案 0 :(得分:-1)
I was also struggling with this.
Somebody has added this https://bintray.com/weimob/maven/react-native/0.55.3 and it will break all React Native Android builds that specify jcenter() in project's repositories.
To avoid this issue, you should force React Native version in android/app/build.gradle file like this compile ("com.facebook.react:react-native:0.52.0") { force = true }. Change 0.52.0 to version you're using.
https://github.com/facebook/react-native/issues/19259#issuecomment-389064401
我找到了这个Google,我认为这可能对您有所帮助。
致谢