React Native项目从0.28升级到0.29 (iOS)

React Native项目从0.28升级到0.29 (iOS)


备忘纪要:


1.升级react-native到0.29.0版本 

方法一:

到项目跟目录下,cmd运行命令: react-native-git-upgrade 0.29.0,运行完毕后,应该没有ERROR类型的消息,会有一些提示信息:需要修改等等,表示react-native升级成功。

参考文章:http://blog.csdn.net/jiangbo_phd/article/details/54693335

方法二:

用 react-nativve-git-upgrade 0.29.0升级失败的情况下,手动升级,方法如下:


Alternative

Use this only in case the above didn't work.

1. Upgrade the react-native dependency

Note the latest version of the react-native npm package from here (or use npm info react-native to check).

Now install that version of react-native in your project with npm install --save:

$ npm install --save react-native@X.Y
# where X.Y is the semantic version you are upgrading to
npm WARN peerDependencies The peer dependency react@~R included from react-native...

If you saw a warning about the peerDependency, also upgrade react by running:

$ npm install --save react@R
# where R is the new version of react from the peerDependency warning you saw
2. Upgrade your project templates(慎用react-native upgrade,如果不熟悉iOS开发,最好是不要执行这一步,只执行第一步既可以:npm install --save react-native@X.Y

The new npm package may contain updates to the files that are normally generated when you run react-native init, like the iOS and the Android sub-projects.

You may consult rn-diff to see if there were changes in the project template files. In case there weren't any, simply rebuild the project and continue developing. In case of minor changes, you may update your project manually and rebuild.

If there were major changes, run this in a terminal to get these:

$ react-native upgrade

This will check your files against the latest template and perform the following:

  • If there is a new file in the template, it is simply created.
  • If a file in the template is identical to your file, it is skipped.
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.


2.  没有使用react-native upgrade命令,这个命令会修改相关模板文件,导致原项目中很多地方需要修改,本次升级并没有使用

慎用react-native upgrade,如果不熟悉iOS开发,最好是不要执行这一步,只执行第一步既可以:npm install --save react-native@X.Y


3. 链接项目RCTWebSocket.m文件编译时,会提示没有处理返回值,按照下面截图的方式处理;

如果有其他项目编译出错,则按照提示进行修改




4. 注意:命令执行完毕后,会自动把之前的某些第三方的插件删除(node_modules目录下),具体原因未知,从原来的备份的文件中将丢失的模块拷贝到升级后的项目中既可。


1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合;、下 4载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合;、下载 4使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合;、下载 4使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值