Command PhaseScriptExecution failed with a nonzero exit code flutter
9,428
Solution 1
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)
Solution 2
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.

Author by
elhoucine ayoub
Updated on December 14, 2022Comments
-
elhoucine ayoub 5 months
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