执行 run-ios 时报错 Failed to connect to (太长写在内容中)443: Connection refused



  • Environment :

    node v8.1.0
    react-native-cli: 2.0.1
    react-native: 0.45.1
    xcode 8.3.3
    OSX 10.12.5

    react-native init AwesomeProject
    cd AwesomeProject
    react-native run-ios

    terminal display:

    .
    .
    .
    export arch=x86_64
    export variant=normal
    /bin/sh -c /Users/Martin/Dev/ReactNative/MyReactNavtiveProject/ios/Build/Intermediates/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 376 0 --:--:-- 0:00:01 --:--:-- 376

    curl: (7) Failed to connect to github-production-release-asset-2e65be.s3.amazonaws.com port 443: Connection refused

    ** BUILD FAILED **

    The following commands produced analyzer issues:

    Analyze /Users/Martin/Dev/ReactNative/MyReactNavtiveProject/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
    Analyze /Users/Martin/Dev/ReactNative/MyReactNavtiveProject/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
    

    (2 commands with analyzer issues)

    The following build commands failed:
    PhaseScriptExecution Install\ Third\ Party /Users/Martin/Dev/ReactNative/MyReactNavtiveProject/ios/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
    (1 failure)

    Installing build/Build/Products/Debug-iphonesimulator/MyReactNavtiveProject.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/MyReactNavtiveProject.app/Info.plist
    Print: Entry, ":CFBundleIdentifier", Does Not Exist

    用VPN也无用


  • administrators

    需要翻墙下载boost
    connection refused表示你被墙了



  • @晴明 我已经翻墙了,问题还是这样。(既然表示被墙了,我翻墙不久可以了,干嘛下载boost)



  • @晴明 谢谢啦,根据你的提示我解决了。
    如果有同学和我一样的话,可以看一下我下面的详细步骤。
    我花了点时间具体看了一下。
    我根据报错信息,找到Script-190EE32F1E6A43DE00A8543A.sh文件并打开,发现该脚本是在$HOME/.rncache中下载4个压缩文件并解压到相关文件位置。打开$HOME/.rncache发现里面只有前两个,那就是命令下载boost_1_63_0.tar.gz的时候被墙了,所以手动下载,并手动放到(手动下载可能名字不一致需要改一下)$HOME/.rncache下,在执行 run-ios就解决上述问题了。
    0_1497447522709_8C0488A2-01AC-422B-9CDC-396B958FB296.png

    补充:
    但是依然会报错 Print: Entry, ":CFBundleIdentifier", Does Not Exist
    可能的解决方案:
    需要自定义build路径
    用Xcode打开,选择菜单File->project settings...0_1497447777452_BC14CDBF-F1B6-45EA-AB0B-789E024BA2F0.png

    然后点击advanced...
    0_1497447875579_5F37936A-6E9E-499C-90E3-141E2A01FF22.png

    自定义编译路径
    0_1497448001945_D214BD09-A950-4F27-AEB8-4CDBC04F5547.png

    再执行命令 run-ios试试 。



  • 如果报的错误是 :/bin/sh -c /Users/Martin/Dev/ReactNative/MyReactNavtiveProject/ios/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
    .
    .
    .
    curl: (7) Failed to connect to github-production-release-asset-2e65be.s3.amazonaws.com port 443: Connection refused

    解决方案:
    翻墙手动下载 https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz

    把下载的文件boost_1_63_0.tar.gz拖到 ~/Users/{User}/.rncache 下。

    (.rncache为隐藏文件,默认是看不到的,需要在终端输入defaults write com.apple.finder AppleShowAllFiles -bool true/false )


登录后回复