title: How to fix Command PhaseScriptExecution failed with a nonzero exit code on flutter run in macOS?
body: <p>I am working on a flutter app. I recently shifted to macOS and since then haven't been able to run the app. Other apps are running fine so I think the error is in within the code of this app. And maybe because of this same reason I am unable to make a build.</p>
  <p>Here is the output of <code>flutter doctor</code>:</p>
  <pre><code>[✓] Flutter (Channel stable, 1.20.1, on Mac OS X 10.15.6 19G73, locale en-US)
      • Flutter version 1.20.1 at /Users/bhawna/dev/flutter
      • Framework revision 2ae34518b8 (4 days ago), 2020-08-05 19:53:19 -0700
      • Engine revision c8e3b94853
      • Dart version 2.9.0
  
  [✗] Android toolchain - develop for Android devices
      ✗ Unable to locate Android SDK.
        Install Android Studio from: https://developer.android.com/studio/index.html
        On first launch it will assist you in installing the Android SDK components.
        (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
        If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
        You may also want to add it to your PATH environment variable.
  
  
   
  [✓] Xcode - develop for iOS and macOS (Xcode 11.6)
      • Xcode at /Applications/Xcode.app/Contents/Developer
      • Xcode 11.6, Build version 11E708
      • CocoaPods version 1.9.3
  
  [!] Android Studio (not installed)
      • Android Studio not found; download from https://developer.android.com/studio/index.html
        (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
  
  [✓] VS Code (version 1.47.3)
      • VS Code at /Applications/Visual Studio Code.app/Contents
      • Flutter extension version 3.13.2
  
   
  [✓] Connected device (1 available)            
      • iPhone 8 (mobile) • 3D03BDE4-F1A6-45AB-B095-01107CDDC2CD • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
  </code></pre>
  <p>Output of <code>flutter run</code>:</p>
  <pre><code>Running &quot;flutter pub get&quot; in delivero...                            1.6s
  Launching lib/main.dart on iPhone 8 in debug mode...
   
  Running pod install...                                             38.2s
  Running Xcode build...                                                  
                                                     
  Xcode build done.                                           449.0s
  Failed to build iOS app
  Error output from Xcode build:
  ↳
      ** BUILD FAILED **
  
  
  Xcode's output:
  ↳
      /Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
      m:45:52: warning: assigning to 'id&lt;IAPPromotionObserverDelegate&gt;' from incompatible type 'FlutterInappPurchasePlugin *__strong'
          [IAPPromotionObserver sharedObserver].delegate = self;
                                                         ^ ~~~~
      /Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
      m:200:79: warning: implicit conversion loses integer precision: 'SKPaymentTransactionState' (aka 'enum
      SKPaymentTransactionState') to 'int' [-Wshorten-64-to-32]
                                                           [NSNumber numberWithInt: item.transactionState], @&quot;transactionStateIOS&quot;,
                                                           ~                        ^~~~~~~~~~~~~~~~~~~~~
      /Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
      m:586:71: warning: implicit conversion loses integer precision: 'SKPaymentTransactionState' (aka 'enum
      SKPaymentTransactionState') to 'int' [-Wshorten-64-to-32]
                                                   [NSNumber numberWithInt: transaction.transactionState], @&quot;transactionStateIOS&quot;,
                                                   ~                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      3 warnings generated.
      /Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:6:4:
      warning: 'SwiftContactsServicePlugin' is only available on iOS 9.0 or newer [-Wunguarded-availability]
        [SwiftContactsServicePlugin registerWithRegistrar:registrar];
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
      In file included from
      /Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:2:
      /Users/bhawna/delivero/delivero/build/ios/Debug-iphonesimulator/contacts_service/contacts_service.framework/Headers/contacts_serv
      ice-Swift.h:213:12: note: 'SwiftContactsServicePlugin' has been marked as being introduced in iOS 9.0 here, but the deployment
      target is iOS 8.0.0
      @interface SwiftContactsServicePlugin : NSObject &lt;FlutterPlugin&gt;
                 ^
      /Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:6:4:
      note: enclose 'SwiftContactsServicePlugin' in an @available check to silence this warning
        [SwiftContactsServicePlugin registerWithRegistrar:registrar];
         ^~~~~~~~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      /Users/bhawna/dev/flutter/packages/flutter_tools/bin/xcode_backend.sh: line 13: pushd: /Users/hrvoje/Documents/Delivero
      Files/contactsFeature: No such file or directory
      Command PhaseScriptExecution failed with a nonzero exit code
      note: Using new build system
      note: Building targets in parallel
      note: Planning build
      note: Constructing build description
  
  Could not build the application for the simulator.
  Error launching application on iPhone 8.
  </code></pre>
  <p>Any help would be great. Thanks for your time.</p>