更新xcode 8.3-->9.3,RN archive一

2018-04-25  本文已影响304人  慧惠

首先,我更新了xcode( 8.3-->9.3)。
后面,我在模拟器上运行RN的时候,一切正常。
接着,我就开始打包,在archive的时候开始报错。

错误一:

错误一

解决方法:

cd node_modules/react-native/third-party/glog-0.3.4
../../scripts/ios-configure-glog.sh

clean the project and build again, the error is gone
其实执行 .sh 命令之后Terminal界面的一些处理流程,我们不难看出,这个命令是check .h头文件的引用情况,然后建立关联关系

错误一的解决鸣谢(https://blog.csdn.net/qq_28978893/article/details/78720488
这个链接。

错误二:

Script-00DD1BFF1BD5951E006B06BC.sh: line 3: 
../node_modules/react-native/packager/react-native-xcode.sh: No such file or directory
解决方法:
1.打开 Xcode Build Phases > Bundle React Native code and images
2修改export NODE_BINARY=node ../node_modules/react-native/packager/react-native-xcode.sh 为export NODE_BINARY=node ../node_modules/react-native/scripts/react-native-xcode.sh

据描述,react-native 低版本升级到0.49以上版本时会遇到这个坑。
但是我升级xcode之后也遇到了这个error。
后来因为xcode9.3一直archive报错,以为是RN的版本低了,所以将0.44.3的版本升级到0.46,也出现了这个error。

错误二的解决鸣谢(https://www.jianshu.com/p/98c8f2a970eb
这个链接 的第39条。

错误三:

react-native-xcode.sh': not a valid identifier
To solve this problem use following steps :
Use node version v4.2.1
1、cd into [your app]/node_modules/react-native/packager
2、$sh ./packager.sh (for some reason this runs fine)
3、Go into XCode and go to the Build Phases tab.
 Remove the last item on the list (the one that runs the script). 
(就是删除 Xcode Build Phases > Bundle React Native code and images)

**特别注意**
删除 Bundle React Native code and images之后,打包是OK了,
但是ios在真机上跑的时候就会出现  找不到jsbundle的bug了,到时候不要心慌,也许可以再把它加上去。

So you're left with Target Dependencies, 
Compile Sources, Link Binary With Libraries, and Copy Bundle Resources.
Now hit build in XCode. Since the shell script is no longer part of the XCode build routine,
 it shouldn't fail. And if you have the react native client server running in another terminal window, then everything should run fine.

错误三的解决鸣谢(https://stackoverflow.com/questions/33650380/react-native-error-react-native-xcode-sh-line-45-react-native-command-not-f
这个链接 。

最後
我放弃了,xcode9.3果然不是那么好打包的。所以进了 https://developer.apple.com/download/more/ 這個链接。

登陆下苹果账号就可以看到的页面
上一篇下一篇

猜你喜欢

热点阅读