After updating to Catalina 10.15.4 beta with Xcode 13.4 beta, which also updated Simulator to 13.4 (921.4).
The application compiles and runs correctly on a physical
I have tried the solution on the official website of flutter but it didn't work for me, so I found a temporary solution which worked for me, but it took me some hard works: Here is my example with project stuck_framework which is a fresh new project (first time run on the simulator)
I created 2 folders inside flutter project called
"ios_simulator" and "ios_real_device".
enter image description here
Now my first build was for the simulator, then I want to switch to a real device, I will move ios folder inside Flutter project to the "ios_simulator"
Manually upgrading flutter to version 1.15 solve this issue as well. Running flutter version v1.15.17
helped me.
Also, you can switch to beta
or dev
channels by running flutter channel
command but be sure you check your code against all BC changes...
Xcode 11.4 changed the way frameworks are linked and embedded, and you may experience issues switching between iOS devices and simulators. Flutter v1.15.3 and later will automatically migrate your Xcode project.
To get unstuck, follow the instructions below;
rm -rf ios/Flutter/App.framework
Official recommended Steps to migrate manually
Change the Runner target build settings Build Phases > Thin Binary script as follows:
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin
In the Runner target Build Settings > Other Linker Flags
(OTHER_LDFLAGS) add $(inherited) -framework Flutter
Hope it helps!
None of the other solutions here worked for me. In my case, the problem was fixed by searching my project for ONLY_ACTIVE_ARCH and changing them all to YES. I found my solution here:
https://developer.apple.com/forums/thread/656509
Xcode 11.4 changed the way frameworks are linked and embedded, which is causing issues switching between iOS devices and simulators.
Please follow official guide on how to migrate your project.
This error is caused by the Xcode 11.4 and can be resolved by Removing / Re-Embedding frameworks and adding a new Run Script Phase.
Under General -> "Frameworks, Libraries, and Embedded Content"
Under Build Phases add a new run script phase.
Select the "+" button in the "Build Phases" pane to create a "New Run Script Phase".
Confirm the script is the bottommost build phase, and configure its fields.
/bin/sh
(which is the default value).rm -r "FRAMEWORK_DIRECTORY/YOUR_FRAMEWORK.framework/"