Flutter runs stuck in the iOS simulator and solves the problem

When we try to run flutter run on the iOS simulator, there may be stuck problems like the following.

 1 2 3 
executing: xcrun simctl launch xxx - 54 F9 - 427 F - 8119 - xxxx com . hahaha . app -- enable - dart - profiling -- enable - checked - mode -- verify - entry - points -- observatory - port = 0 [+ 1000 ms ] com . hahaha . app : 49573 [ ] Waiting for observatory port to be available …

The app on the emulator cannot be opened, and there is no specific crash problem. do not know what to do.

However, there is still a solution, which is to use XCode to run the project and view the output

Open the project with Xcode

 1 2 
cd ios / open Runner . xcworkspace

Click to run

Like a normal iOS project, click the play button to compile and run.

View logs

After running, probably in the lower right corner of XCode, you will find a certain error message

 1 2 3 4 5 
dyld: Symbol not found: _$s7SwiftUI4ViewP14_viewListCountxxdddx6inputsSiSgxxxAA01_ceF6xxdxxddInputsV_tFZxxxxTq Referenced from: / Users / xxxxx / Library / Developer / CoreSimulator / Devices / xxxxddxx - 54 F9 - 427 F - 8119 - xxxxx / data / Containers / Bundle / Application / xxxx - 8791 - 4 B78xxx - A9C1 - 381572 AC1A2B / Runner . app / Frameworks / abcde . framework / abcde ( which was built for iOS 14.0 ) Expected in: / System / Library / Frameworks / SwiftUI . framework / SwiftUI in / Users / xxxxxx / Library / Developer / CoreSimulator / Devices / xxxxx - 54 F9 - 427 F - 8119 - xxxxxx / data / Containers / Bundle / Application / xxxxx - 8791 - 4 B78 - xxxx - 381572 xAC1A2B / Runner . app / Frameworks / abcde . framework / abcde dyld: launch , loading dependent libraries

By analyzing the above error log, we can determine that the problem is because the application cannot be run on emulators below 14.

droidyue_gzh_green_png.png

This article is reprinted from https://droidyue.com/blog/2022/05/08/flutter-run-stuck-with-log-waiting-for-observatory-port-to-be-available/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment