5

I am getting the error below when compiling Flutter projects (I have already created a project from scratch and I have the same error). I started having this error after deleting some files to free up space on my Mac.

I have already reinstalled Xcode because I didn't know what else to do, I searched the entire internet for a solution but I didn't find anything.

Launching lib/main.dart on iPhone 14 in debug mode... main.dart:1 Xcode build done. 2,8s Failed to build iOS app Error (Xcode): Target debug_unpack_ios failed: Exception: Binary /Users/lucasbarreto/developer/test_compile/build/ios/Debug-iphonesimulator/Flutter.framework/Flutter does not exist, cannot thin Could not build the application for the simulator. Error launching application on iPhone 14. Exited

My flutter doctor settings:

[✓] Flutter (Channel stable, 3.10.6, on macOS 13.2.1 22D68 darwin-arm64, locale pt-BR)
    • Flutter version 3.10.6 on channel stable at /Users/lucasbarreto/fvm/versions/3.10.6
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (4 weeks ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/lucasbarreto/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2022.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 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.81.0)
    • VS Code at /Users/lucasbarreto/Visual Studio Code.app/Contents
    • Flutter extension version 3.70.0

[✓] VS Code (version 1.79.0-insider)
    • VS Code at /Users/lucasbarreto/Visual Studio Code - Insiders.app/Contents
    • Flutter extension version 3.71.20230801

[✓] Connected device (3 available)
    • iPhone 14 (mobile) • 53A0CEA2-8655-43A6-9523-78D5C99569AD • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4
      (simulator)
    • macOS (desktop)    • macos                                • darwin-arm64   • macOS 13.2.1 22D68 darwin-arm64
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 115.0.5790.170

[✓] Network resources
    • All expected network resources are available.
3
  • Did you found any solution? It happened to me using any IDE expect in Xcode, too weird! Idk what more else to do! Commented Aug 23, 2023 at 20:11
  • My solution was to give flutter upgrade switching to the latest version. You can also test by going to the latest unstable version. Commented Aug 23, 2023 at 20:59
  • 2
    I realize that there is a bug with cloud sync folders even if you use .noSync (in iCloud's case) so you just need to move your desired project to a non sync folder and everything will work properly with the latest version of flutter and Xcode beta 6 🤓 Commented Aug 24, 2023 at 12:33

2 Answers 2

1

Just change the flutter directory where you put the flutter. And also change your path in Android Studio.

  1. Change the flutter path
  2. AndroidStudio -> Settings -> Dart (Change the path) -> Flutter (Change the path)
Sign up to request clarification or add additional context in comments.

Comments

0

First answer

You need to restore the Flutter binary to this directory:

(/Users/user1/Developer/flutter/bin/cache/artifacts/engine/iOS/Flutter.xcframework/ios-arm64_x86_64-simulator).

You can detect the version of Flutter you are using and download it again. You can copy the ios-arm64_x86_64-simulator folder in the newly downloaded folder, delete the old one and paste this one instead.

Second answer

If you want to apply a shorter method, you can change the name of your old flutter installation to flutter2 and copy the new folder you downloaded as flutter here. Then delete flutter2

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.