【问题标题】:Command PhaseScriptExecution failed with a nonzero exit code flutter命令 PhaseScriptExecution 因非零退出代码颤动而失败
【发布时间】:2020-01-16 13:47:29
【问题描述】:

当我尝试将颤振添加到现有的 iOS 应用程序时出现错误,它在 android 端运行良好,在 IOS 中我收到此错误消息:

/Users/mac/Library/Developer/Xcode/DerivedData/Fixit- dffmmspbqmueppghdvveloietubr/Build/Intermediates.noindex/Fixit.build/Debug- iphoneos/Fixit.build/Script-04B0EA9A232E6ABD008A0448.sh: line 3: /packages/flutter_tools/bin/xcode_backend.sh: No such file or directory

/Users/mac/Library/Developer/Xcode/DerivedData/Fixit- dffmmspbqmueppghdvveloietubr/Build/Intermediates.noindex/Fixit.build/Debug- iphoneos/Fixit.build/Script-04B0EA9A232E6ABD008A0448.sh: line 4: /packages/flutter_tools/bin/xcode_backend.sh: No such file or directory

Command PhaseScriptExecution failed with a nonzero exit code

在我的 pod 文件中,我在目标应用程序中添加了这个:

flutter_application_path = '⁨Users⁩/mac⁩/FixitApps⁩/customerApp⁩/fixit_flutter_customer_app/'
eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)

我遵循了这个教程:https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps

【问题讨论】:

    标签: ios xcode flutter command-line podfile


    【解决方案1】:

    如果您在构建阶段创建了一个用于构建 dart 代码的脚本文件,请将其删除并将其添加到您的 podfile 中:

    flutter_application_path = '⁨Users⁩/mac⁩/FixitApps⁩/customerApp⁩/fixit_flutter_customer_app/'
    eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)
    
    install_all_flutter_pods(flutter_application_path)
    

    【讨论】:

      【解决方案2】:

      将颤振通道切换到主修复 macOS 桌面嵌入上的 PhaseScriptExecution 错误。切换到 master 分支应该可以解决问题

      将频道切换到master解决了。

      flutter channel master
      

      然后删除旧模块并重新创建它

      flutter create -t module my_flutter
      

      下一个

      pod install
      

      最后清理xcode项目,重启Xcode,Cmd+B错误消失。

      【讨论】:

      • flutter channel master 和 flutter upgrade 修复了这个问题
      【解决方案3】:

      就我而言,当我从资产中删除了一些文件但忘记从 pubspes.yaml 中删除时。

      错误解决后

      1. 从 pubspes.yaml 中删除已删除的文件
      2. 点击pub get
      3. 在设备上运行

      【讨论】:

        【解决方案4】:

        我正在使用云虚拟计算机来构建我的 iOS 应用程序,在这种情况下,当我构建应用程序时,机器在我再次连接后断开连接,出现上述错误。但是我关机重启后,并没有弹出这个错误。

        【讨论】:

          猜你喜欢
          • 2021-05-10
          • 1970-01-01
          • 1970-01-01
          • 2021-10-15
          • 2020-06-27
          • 2020-12-18
          • 2020-05-13
          • 2020-10-25
          • 2021-04-30
          相关资源
          最近更新 更多