代碼地址
https://github.com/attentiveness/reading
配置步驟:
1.報錯代碼
Command /bin/sh failed with exit code 1
解決方案:
項目->Build Phases->Bundle React Native code and images -> 勾選 Run script only when installing
2.報錯代碼:
'boost/iterator/iterator_adaptor.hpp' file not found
解決方案:
2.1刪除 你本地的nodemodules文件夾
2.2把你本地的page.json代碼清空粘上如下代碼
{
"name": "reading",
"version": "2.1.0",
"description": "iReading App Write In React-Native",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git@github.com:attentiveness/reading.git"
},
"engines": {
"node": ">=4"
},
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"lint": "eslint app --fix",
"format": "find app -name '*.js' | xargs prettier --write --single-quote"
},
"dependencies": {
"leancloud-storage": "3.0.4",
"lodash": "^4.17.4",
"moment": "^2.18.1",
"react": "16.0.0-alpha.6",
"react-native": "0.44.3",
"react-native-code-push": "^5.0.0-beta",
"react-native-device-info": "^0.11.0",
"react-native-exceptions-manager": "^0.2.0",
"react-native-scrollable-tab-view": "0.7.4",
"react-native-simple-store": "^1.3.0",
"react-native-timeago": "^0.3.0",
"react-native-vector-icons": "^4.3.0",
"react-native-wechat": "^1.9.9",
"react-navigation": "^1.0.0-beta.12",
"react-redux": "^5.0.5",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",
"redux-saga": "^0.15.6"
},
"jest": {
"preset": "react-native"
},
"devDependencies": {
"babel-eslint": "^7.2.3",
"babel-jest": "^20.0.3",
"babel-preset-react-native": "2.0.0",
"eslint": "^4.5.0",
"eslint-config-airbnb": "^15.1.0",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.3.0",
"jest": "^20.0.4",
"prettier": "^1.5.3",
"react-test-renderer": "16.0.0-alpha.6",
"redux-devtools": "^3.4.0"
}
}
2.3cd到工程路徑下,
npm install
rnpm link
2.4 appdelegate.m中改變一行代碼,如下 , 運行即可