m23
m23

Reputation: 21

Flutter in VS code is not launching app in the iOS simulator

I started learning flutter. I have everything installed for flutter. I created the first flutter app with the command flutter create xyz then I used flutter run to launch the app in the iOS simulator. It works fine and launches the default flutter counter app with no problem. Now when I open up the project in VS Code and try to launch from there with run with debugging option the app doesn't launch in the iOS simulator. Instead it gives me the following error.

Launching lib/main.dart on iPhone 11 in debug mode...
Xcode build done.                                           15.8s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **

Xcode's output: ↳

/Users/maxim/Desktop/flutterAppFolder/second_app/build/ios/Debug-iphonesimulator/Runner.app: resource fork, Finder information, or similar detritus not allowed
Command CodeSign 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.
Exited (sigterm)

image

PS. I have used flutter before in fact like an hour before I was working with vs code on a flutter app it was working fine. It was launching the app in the iOS simulator without any issue.

Upvotes: 2

Views: 5756

Answers (3)

Just update Xcode and Flutter:

  • Flutter update on terminal: flutter upgrade
  • Xcode update from AppStore.

Then restart and clean VSCode and Xcode.

Upvotes: 0

thealphaopen
thealphaopen

Reputation: 11

Remove the ios folder with ** rm -r ios ** and run the following command to create a new ios folder flutter create . that sould resolve the prb

Upvotes: -3

Henok
Henok

Reputation: 3383

  1. Open ios/Runner.xcworkspace Select the Runner project in the project navigator sidebar.
  2. In the main view, select the Runner target, then select the Build Phases tab.
  3. Expand the Embed Frameworks phase and select Flutter.framework from the embedded frameworks list.
  4. Click on the - to remove Flutter.framework from the list (keep App.framework).

Upvotes: 1

Related Questions