skip to Main Content

I have wasted almost a week on this problem without avail.

This is the error:

Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/fq/7j2x58m57c9bk10jg7q47krr0000gn/T/flutter_tools.vyKPSp/flutter_ios_build_temp_di
        rGZCufm/temporary_xcresult_bundle


    Failed to package /Volumes/ME/Projects/Flutter-Proj/app.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Building targets in dependency order
    warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every
    build because it does not specify any outputs. To address this warning, either add output
    dependencies to the script phase, or configure it to run in every build by unchecking "Based on
    dependency analysis" in the script phase. (in target 'BoringSSL-GRPC' from project 'Pods')
    warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every
    build because it does not specify any outputs. To address this warning, either add output
    dependencies to the script phase, or configure it to run in every build by unchecking "Based on
    dependency analysis" in the script phase. (in target 'abseil' from project 'Pods')
    warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every
    build because it does not specify any outputs. To address this warning, either add output
    dependencies to the script phase, or configure it to run in every build by unchecking "Based on
    dependency analysis" in the script phase. (in target 'Libuv-gRPC' from project 'Pods')
    warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every
    build because it does not specify any outputs. To address this warning, either add output
    dependencies to the script phase, or configure it to run in every build by unchecking "Based on
    dependency analysis" in the script phase. (in target 'gRPC-Core' from project 'Pods')
    warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every
    build because it does not specify any outputs. To address this warning, either add output
    dependencies to the script phase, or configure it to run in every build by unchecking "Based on
    dependency analysis" in the script phase. (in target 'gRPC-C++' from project 'Pods')
    warning: Run script build phase 'Run Script' will be run during every build because it does not
    specify any outputs. To address this warning, either add output dependencies to the script
    phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the
    script phase. (in target 'Runner' from project 'Runner')
    note: Run script build phase 'Thin Binary' will be run during every build because the option to
    run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from
    project 'Runner')
    warning: Run script build phase '[firebase_crashlytics] Crashlytics Upload Symbols' will be run
    during every build because it does not specify any outputs. To address this warning, either add
    output dependencies to the script phase, or configure it to run in every build by unchecking
    "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')

    Result bundle written to path:
        /var/folders/fq/7j2x58m57c9bk10jg7q47krr0000gn/T/flutter_tools.vyKPSp/flutter_ios_build_temp_di
        rGZCufm/temporary_xcresult_bundle


Could not build the precompiled application for the device.

Error launching application on iPhone.

These are the things I have tried:

  1. Refreshing Flutter and Pod

    • rm Podfile.lock
    • flutter clean
    • flutter pub get
    • pod repo update
    • pod install
  2. Clearing pod cache and redo the above.

  3. Reinstalled Xcode, Flutter, Android Studio.

  4. Check/uncheck For install builds only and/or Based on dependency analysis.

  5. Followed many kinds of solutions: [here] (How to fix Command PhaseScriptExecution failed with a nonzero exit code on flutter run in macOS?), [here] (Command PhaseScriptExecution failed with a nonzero exit code while trying to add Flutter to iOS app), and [here] (Flutter Failed to package. Command PhaseScriptExecution failed with a nonzero exit code). And many more like these.

  6. Checked all PNG files for errors by using pngcheck

None of the above works.

[UPDATE] 7. Tried to buy a new computer with all fresh install. Still does not work.
8. Tried to re-create the Flutter app.

My flutter doctor -v

[✓] Flutter (Channel stable, 3.3.4, on macOS 12.6 21G115 darwin-x64, locale en-US)
    • Flutter version 3.3.4 on channel stable at /Users/ME/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision eb6d86ee27 (5 days ago), 2022-10-04 22:31:45 -0700
    • Engine revision c08d7d5efc
    • Dart version 2.18.2
    • DevTools version 2.15.0
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Volumes/ME/Applications/Android/sdk
    • Platform android-32, build-tools 32.0.0
    • ANDROID_HOME = /Volumes/ME/Applications/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14A400
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.71.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.48.0

[✓] Connected device (3 available)
    • iPho (mobile) • 00012101-001965606543001E • ios            • iOS 15.6.1 19G82
    • macOS (desktop)     • macos                     • darwin-x64     • macOS 12.6 21G115
      darwin-x64
    • Chrome (web)        • chrome                    • web-javascript • Google Chrome
      105.0.5195.125

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

5

Answers


  1. Please follow the below step

    1. Go to the iOS folder and delete the podfile.lock,pods,xcworkspace
    2. Go to the root folder and use flutter clean
    3. flutter pub get
    4. Go to the iOS folder and user pod install

    N:B: Remember remove xcworkspace file other wise it will not work and check your pod is updated or not. if your pod is not updated then use pod repo update.

    Login or Signup to reply.
  2. Try the following step.

    1. Go to the root folder and run the command "flutter clean"
    2. Run the command "dart pub get"
    3. Run the command "flutter pub get"
    4. Go to the iOS folder and run the command "pod install"
    5. Go to the root folder and run the command "flutter run –no-sound-null-safety"
    Login or Signup to reply.
  3. Hi i had this error and after weeks of multiple failed attempts.

    I had found a solution, that worked for me

    Under Project runner | configurations

    Change the configurations set from Pods-Runner.debug to Debug.

    After changing this the app would build.

    Really hope this works for you as i know how frustratingthis was for me.

    Login or Signup to reply.
  4. After hours spent on resolving this problem I am giving solution that has worked in my case: run

    dart fix --apply

    in terminal to resolve all warnings, as recommended here.

    Login or Signup to reply.
  5. Installing Rosetta, fixed it for me!:

    sudo softwareupdate --install-rosetta --agree-to-license
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search