【问题标题】:react-native ios build xcode 12/13 (react-native run-ios) failed with PhaseScriptExecution and CompileSwiftSources errorreact-native ios build xcode 12/13 (react-native run-ios) 因 PhaseScriptExecution 和 CompileSwiftSources 错误而失败
【发布时间】:2021-11-14 20:03:02
【问题描述】:

我正在尝试在 ios 上构建 react-native,但它会抛出错误

版本:

react-native info
info Fetching system and libraries information...
System:
    OS: macOS 11.4
    CPU: (4) x64 Intel(R) Core(TM) i3-8100B CPU @ 3.60GHz
    Memory: 12.08 GB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 14.16.1 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.1.0 - /usr/local/bin/npm
    Watchman: 2021.11.01.00 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7678000
    Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
  npmPackages:
    react: 17.0.1 => 17.0.1 
    react-native: ^0.64.2 => 0.64.2 
  npmGlobalPackages:
    create-react-native-app: 3.5.3
    react-native-asset: 2.0.1
    react-native: 0.60.6

在 Xcode 构建中,它在以下位置失败:

详情:

如果你跑了

react-native run-ios

上面说两个命令失败了,它们是:

The following build commands failed:
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'FBSDKCoreKit' from project 'Pods')

    PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/user204444/Library/Developer/Xcode/DerivedData/xUI-awhgnkdgdnqqhybhizmenofqnvvg/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-50E87D65053FE4ADFF2772B365B2C6E0.sh 

  (in target 'FBReactNativeSpec' from project 'Pods')
(2 failures)

任何帮助将不胜感激

【问题讨论】:

    标签: react-native react-native-fbsdk


    【解决方案1】:

    1.要修复第一个错误,请尝试:

    `rm -rf ./node_modules`
    `yarn install` // or npm install
    `cd ios && rm -rf ./Pods && rm -rf Pofile.lock && pod install && cd ..`
    `npx react-native run-ios`
    

    2。修复第二个错误:

    • 尝试在 Podfile 中删除/评论 Flipper
    • 确保您已排除了模拟器的 arm64 架构

    注意:在将 Xcode 升级到 13.1 后出现PhaseScriptExecution 错误:

    dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.67.dylib.

    我修复了它: brew updatebrew install

    如果还是不行,请附上你的问题:

    1. Podfile的全部内容
    2. pod install 命令的结果
    3. react-native run-ios 命令的完整日志

    如果没有完整的完整错误日志,您的错误太笼统,无法调试。

    【讨论】:

      【解决方案2】:

      我总是遇到这个问题。请按照以下步骤删除错误。

      • 从项目的根目录,做cd ios
      • pod deintegrate
      • pod install

      如果这没有帮助,请删除node_modules,然后在npm installyarn install 之后尝试上述操作,如下所示。

      在项目的根目录下,执行以下操作

      • rm -rf node_modules
      • npm install / yarn install
      • cd ios
      • pod deintegrate
      • pod install
      • cd ..
      • react-native run-ios

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-09-09
        • 2016-10-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-12-23
        相关资源
        最近更新 更多