iOS RN 0.45以上版本所需的第三方编译库(boost等)
-
第三方依赖库百度盘链接: http://pan.baidu.com/s/1kVDUAZ9
RN iOS 0.45以上版本开始需要依赖一些第三方编译库,这些库在国内下载都非常困难(一般的翻墙工具都很难下载)
未来RN不同版本可能依赖不同版本的第三方编译库,具体所需库和版本请查看ios-install-third-party.sh文件,注意先把左上角的branch切换到对应的版本
然后在底部查看所需的依赖库名字和版本
然后去网盘里下载↓
第三方依赖库百度盘链接: http://pan.baidu.com/s/1kVDUAZ9
下下来后请放置到以下目录中:
0.58及以上版本:
~/Library/Caches/com.facebook.ReactNativeBuild
或是自定义
$RN_CACHE_DIR
环境变量自己指定一个路径
0.58以下的版本:
~/.rncache
比如你可以打开终端,输入
# 井号表示注释,不要复制井号开头的句子 # 创建目录,如果已经存在就不会创建了 cachedir="$HOME/Library/Caches/com.facebook.ReactNativeBuild" mkdir -p $cachedir # 进入刚刚创建的目录 cd $cachedir # 复制文件 cp ~/Downloads/boost_1_63_0.tar.gz ./
全部复制完成后,就可以开始init新的RN项目,或者删掉已有项目的node_modules重新npm install再run-ios。
-
@晴明 这些三方依赖库必须放置在用户根目录下面吗?我想将应用放置在一个自定义的目录下怎么操作?尝试设置了但是运行程序报错
-
@dearMartlet 人家必然是写好了路径,你如果知道人家写在哪你就去哪改,不知道写在哪就自己去研究,既不知道也不研究那就照着别人的要求做,既不知道也不研究还不照着别人的要求做——你咋不上天呢
-
@晴明 额,好吧,您说的对。
-
你好,我这个加了,但是新建项目,没指定版本 ,还是跑不起来,会报错啊 ,求指教,谢谢!
-
@zhangfogao 重启电脑 /Mac Os 更新下
-
/bin/sh -c /Users/chen/ReactNative/ProgramKids/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 609 0 609 0 0 403 0 --:--:-- 0:00:01 --:--:-- 403
0 0 0 0 0 0 0 0 --:--:-- 0:01:24 --:--:-- 0curl: (7) Failed to connect to github-production-release-asset-2e65be.s3.amazonaws.com port 443: Operation timed out
Command /bin/sh failed with exit code 7
** BUILD FAILED **
The following commands produced analyzer issues:
Analyze /Users/chen/ReactNative/ProgramKids/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
Analyze /Users/chen/ReactNative/ProgramKids/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
(2 commands with analyzer issues)The following build commands failed:
PhaseScriptExecution Install\ Third\ Party /Users/chen/ReactNative/ProgramKids/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)Installing build/Build/Products/Debug-iphonesimulator/ProgramGirl.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 ExistCommand failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/ProgramGirl.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
-
I have the same problem.My Xcode's version is 7.3. Is the version too low?
-
@ligongxiang 看文档不会吗
-
使用cocoapods的同学,可以引用我的repo
-
想自己封装一个module供其它项目使用,请问具体的步骤是怎样的?
-
@yinmenglong 重启电脑之后,新建项目不加版本号的话,还是会报错。
-
@晴明 管用唉,谢谢, 但是还有个问题想向您请教一下, 我用 命令行run-ios 总是提示我bundle url的报错,但是我用xCode启动就没这个问题, 好久了一直没找到方法解决,
-
@晴明 0.60.3新版安装,在pod install的时候会卡在Installing DoubleConversion (1.1.6)
错误提示:[!] Error installing DoubleConversion
[!] /usr/local/bin/git clone https://github.com/google/double-conversion.git /var/folders/36/bv141b3d2z7_p_xsbrpg5wch0000gn/T/d20190715-17811-dozlgk --template= --single-branch --depth 1 --branch v1.1.6Cloning into '/var/folders/36/bv141b3d2z7_p_xsbrpg5wch0000gn/T/d20190715-17811-dozlgk'...
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: unpack-objects failed
xcode编译也会提示错误'React/RCTBridgeDelegate.h' file not found
我将double-conversion直接下载下来上传到自己的git,修改DoubleConversion.podspec脚本的引用地址,依旧无法下载
-
好像是放在 ~/.rncache里面就行了,建议删了目录里面的东西重新下载
-
@atshitou 我目录有boost_1_63_0.tar.gz,但是依旧会去下载Installing boost-for-react-native (1.63.0)不知道为何
-
应该是文件损坏了。我一般是把third_library目录删掉,让它重新安装。
-
@coder-stan-lv 老哥,我也是卡在了这一步,来来回回重试了好几次也没成功。老哥你要是解决了麻烦圈一下我告知怎么解决呗,我这边如果弄出来了,也会再回复你一次。
-
@smileshang 这个问题目前我解决了,唯一的方式就是不停的重试,这个问题就是网络问题导致的,我尝试过从git直接clone,有时也会失败,所以可以断定是国内网络问题,至于官方说的离线包可以放在rncache中,我试过依旧会执行pod脚本去install,不清楚是不是最新版的执行方式不同,我的rn是0.60.3
-
@atshitou 老哥,你说的这个third_library目录删掉,是怎么一个操作啊,没找到相关的文件啊。