3
votes

I got an error when I tried to add flutter to an existing iOS app it worked fine on the android side, in IOS I got this error message :

/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

inside my pod file i added this inside target application:

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

I followed this tutorial: https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps

4

4 Answers

3
votes

if you create a script file in the build phase for building dart code remove it and add this to your 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)
0
votes

Switching flutter channel to master fixes PhaseScriptExecution errors on macOS Desktop Embedding. Switching to master branch should fix the issue

Solved it by switching channel to master.

flutter channel master

Then delete the old module and recreate it by

flutter create -t module my_flutter

Next

pod install

Finally, clean the xcode project, restart Xcode, Cmd+B the error disappeared.

0
votes

In my case when I have deleted some files from assets but forget to remove from pubspes.yaml.

Error solved after

  1. remove deleted files from pubspes.yaml
  2. click on pub get.
  3. run on device
0
votes

I am using a cloud virtual computer to build my iOS apps, in that case when I'm building the app, the machine got disconnected after I connect it again this above error popped up. But after I turn off the machine and restarted it, this error did not pop up.