Command PhaseScriptExecution failed with a nonzero exit code while trying to add Flutter to iOS app

Solution 1:

This work for me Thanks Alexander Lozano, I upload image for Xcode Version 12.0.1

Xcode Version 12.0.1

Solution 2:

this works for me: xcode 11.3.1

xcode ->targets->runner

in build phases: run script and thin binary, select: run script only when installing

Solution 3:

For beginners: (tested on XCODE 12.0.1) open Xcode--> Open a project or file --> go to the flutter app path/ios directory--> open --> Runner and follow attached image steps enter image description here

Solution 4:

This worked for me:
1) Add this to your podfile:

flutter_application_path = '/Users/dhavalkansara/FlutterToNative/AFE_flutter/'
    eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)

    install_all_flutter_pods(flutter_application_path)

PS. You may also need to do that for each target, i.e

target 'AFEiOSTests' do
    inherit! :search_paths
    install_all_flutter_pods(flutter_application_path)
    # Pods for testing
  end

  target 'AFEiOSUITests' do
    inherit! :search_paths
    install_all_flutter_pods(flutter_application_path)
    # Pods for testing
  end

2) Run pod install