React Native 学习一 搭建开发环境
2017-09-14 18:18
501 查看
参考文章
https://reactnative.cn/ http://www.jianshu.com/p/3dc9d70a790f http://www.jianshu.com/p/b88944250b25 http://www.jianshu.com/p/9211f42d5c25 http://www.cocoachina.com/ios/20170511/19250.html http://www.jianshu.com/p/978c4bd3a759
1按照https://reactnative.cn/
操作:
https://reactnative.cn/ http://www.jianshu.com/p/3dc9d70a790f http://www.jianshu.com/p/b88944250b25 http://www.jianshu.com/p/9211f42d5c25 http://www.cocoachina.com/ios/20170511/19250.html http://www.jianshu.com/p/978c4bd3a759
1按照https://reactnative.cn/
操作:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"[/code]出现需要brew更新错误信息后 ,去往目录手动删除就可以了,不要rm -rf(后果很惨痛)
输入:react-native run-ios 出现以下错误
he following build commands failed:
PhaseScriptExecution Install\ Third\ Party /Users/kangxg/AwesomeProject/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/AwesomeProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
运行 AwesomeProject.xcodeproj 错误:#include <boost/iterator/iterator_adaptor.hpp>
原因:init命令默认会创建最新的版本,而目前最新的0.45版本需要下载boost库编译。此库体积庞大,在国内即便翻墙也很难下载成功,导致很多人无法正常运行iOS项目,推荐暂时使用0.44.3的版本。
解决办法: 创建项目暂时先使用react-native init AwesomeProject --version 0.44.3,指定某个版本。
再次react-native run-ios 运行 AwesomeProject.xcodeproj
运行成功
如果 要运行最新的0.45版本 需要 brew install boost
安装 boost 库即可,但在最后生成软链接的过程中可能出目录写权限的报错问题Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink include/boost /usr/local/include is not writable.
观察报错信息发现/usr/local/include与/usr/local/lib无法写入,
故手动修改权限:sudo chmod -R 777 /usr/local/include sudo chmod -R 777 /usr/local/lib1
之后 brew link boost 库即可
如果上面还是解决不了,就是初始化的时候,有四个包没有安装完整参考下面的地址去做即可解决:
https://hacpai.com/article/1497235254333
//包下载
http://blog.csdn.net/u013751625/article/details/75046147
相关文章推荐
- React Native学习二:搭建Windows开发环境
- Android开发学习笔记(一 )安卓开发环境搭建
- Android学习之 Windows7 Android 开发环境搭建
- STM32 学习一 Keil开发环境搭建
- Android开发学习之路-环境搭建
- React Native 教程——手把手搭建开发环境
- Mybatis学习之开发环境搭建(1)
- GTK+学习:概述 、搭建环境(Windows,Linux)、开发 收藏
- Scala学习第一天 scala开发环境搭建和helloword解析
- React Native搭建开发环境
- 微信开发学习总结(一)——微信开发环境搭建
- golang学习第二篇 开发环境的搭建
- Cocos2d-x学习笔记之开发环境搭建
- 学习Android第一步:安装搭建Android开发环境
- Cocos2d-x学习笔记(一)——Windows开发环境和Android交叉编译环境搭建
- Struts2学习之开发环境搭建
- QT学习笔记----搭建Qt4.7.3嵌入式开发环境
- Android React Native 开发环境搭建---windows下
- sublime学习(五)搭建Python开发环境