最近,Flutter 升级到最新版本之后,iOS 真机调试的时候持续卡住在启动页面。
Xcode 输出如下报错信息:
1 |
Logging Error: Failed to initialize logging system. Log messages may be missing. If this issue persists, try setting IDEPreferLogStreaming=YES in the active scheme actions environment variables. |
Flutter 系统信息如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.22.0, on macOS 14.5 23F79 darwin-arm64, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.3) [✓] IntelliJ IDEA Ultimate Edition (version 2018.3.6) [✓] IntelliJ IDEA Community Edition (version 2024.1) [✓] VS Code (version 1.89.0) [✓] Connected device (4 available) [✓] Network resources • No issues found! |
解决方案:
在 Xcode -> Product -> Scheme -> Edit Scheme 中找到环境变量(Environment Variables),添加即可。
如下图:(图中的变量值需要勾选上才生效)