4

When I try to flutter run a newly created flutter app the build fails with the error below. The computer was used a year ago for Flutter development and I suspect there is some irregular config somewhere causing this error. I've been struggling with this for a few days now and any help would be much appreciated.

Steps to reproduce

  1. flutter create my_app
  2. cd my_app
  3. flutter run

Terminal output:

app/Frameworks/App.framework/App: signed bundle with Mach-O universal
    (x86_64 arm64) [io.flutter.flutter.app]
    /Users/user/Desktop/projects/myApp/build/ios/Debug-iphonesimulator/Runner.
    app/Frameworks/Flutter.framework/Flutter: replacing existing signature
    /Users/user/Desktop/projects/myApp/build/ios/Debug-iphonesimulator/Runner.
    app/Frameworks/Flutter.framework/Flutter: Permission denied
    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 11.

I have tried:

  • Uninstalling and re-installing Xcode
  • Uninstalling and re-installing Flutter
  • Running from Xcode
  • Removing pods/podfiles and re-installing
  • Restarting computer
  • flutter clean
  • Creating a new app
  • Checking compliance with all required Flutter "Get started" instructions
  • Running from Xcode
  • Switching workspace to Legacy Build System
  • Locking & unlocking login in Keychain Access
  • Giving read/write permissions to the project folder and all enclosed items using Finder, and running chmod +x on files

flutter doctor -v output:

[✓] Flutter (Channel stable, 1.20.3, on Mac OS X 10.15.6 19G2021, locale en-GB)
    • Flutter version 1.20.3 at /usr/local/Cellar/flutter/sdk
    • Framework revision 216dee60c0 (6 days ago), 2020-09-01 12:24:47 -0700
    • Engine revision d1bc06f032
    • Dart version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.7, Build version 11E801a
    • CocoaPods version 1.9.3

[!] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

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

[✓] Connected device (1 available)
    • iPhone 11 (mobile) • 034B59B3-8929-4997-B7A1-53E32D065347 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-7 (simulator)

! Doctor found issues in 1 category.

UPDATE: I have opened an issue in the Flutter Github repo.

gcg1
  • 81
  • 1
  • 7
  • 1
    Check out this thread perhaps: https://github.com/flutter/flutter/issues/50568 – Kris Sep 07 '20 at 16:45
  • @Kris Attempted that fix but it did not solve my problem. My error is different, specifically: `Permission denied` `Command PhaseScriptExecution failed with a nonzero exit code` – gcg1 Sep 07 '20 at 18:28

2 Answers2

0

Based on this question, it seems like it's something to do with xcode_backend.sh file making some Flutter files read-only, check the question and this issue, might help you fix it, best of luck.

Yoh
  • 63
  • 10
  • Tried this, but it did not fix my issue. (Comments under that issue mention the problem was resolved in a version of Flutter published in Dec 2019). – gcg1 Sep 08 '20 at 10:01
0

I was finally able to resolve this issue and run the Flutter demo app on the iOS Simulator by taking the following steps:

  1. flutter version v1.11.0 (to downgrade to an earlier version of Flutter)
  2. flutter channel stable
  3. flutter upgrade
  4. flutter doctor
  5. flutter create test_app
  6. cd test_app
  7. flutter run
gcg1
  • 81
  • 1
  • 7