我正在创建一个简单的react-native项目,但是当我将 expo 升级到版本24.0.0
时,意外遇到了错误。
app.json :
{
"name": "TipCalculator",
"displayName": "rn_tip_calculator",
"expo": {
"name": "TipCalculator",
"slug": "rn-tip-calculator",
"sdkVersion": "24.0.0"
}
}
的package.json :
{
"name": "rn_tip_calculator",
"version": "0.0.1",
"private": true,
"author": "GeniusDoan <nhoxbypass@gmail.com> (https://github.com/nhoxbypass)",
"repository": "https://github.com/HCMUS-IceTeaViet-SE/rn_tip_calculator",
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"expo": "^24.0.0",
"react": "^16.0.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-24.0.0.tar.gz",
"react-native-deprecated-custom-components": "^0.1.0",
"react-native-i18n": "^1.0.0",
"react-native-segmented-control-tab": "^3.0.1"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "16.0.0"
},
"jest": {
"preset": "react-native"
}
}
这是2017年11月的已知问题,我已经阅读了许多关于它的Github问题。它发生在react-native v50.0
。
但在我的项目中,我使用的是最新的本地版本v51.0
,但它仍然无效。我在Android 6.0上运行我的应用。
任何帮助将不胜感激!
答案 0 :(得分:4)
这个问题似乎是一个React Native错误,这里已经讨论了临时解决方案。
https://github.com/facebook/react-native/issues/16522#issuecomment-345513116
答案 1 :(得分:0)
Expo SDK 26仍然是一个问题,根据上面这个注释的描述很多字符长