Flutter run仅能运行主目录项目 其他目录下iOS调试构建失败
Flutter项目存放在OneDrive路径下时iOS Simulator调试失败
问题背景
- 该问题已排查多日,Stack Overflow、GitHub上的大量同类问题方案均不适配当前特殊场景
- 日常从事Flutter应用开发,主要通过Xcode在iOS Simulator上调试应用,此前调试流程始终运行正常,所有遇到的问题均可通过简单检索解决
故障现象
当Flutter项目存放在Mac端OneDrive等非用户主目录的路径下时,iOS Simulator调试功能无法正常运行。
终端输出的报错信息如下:
Launching lib/main.dart on iPhone 13 Pro Max in debug mode... lib/main.dart:1 Xcode build done. 6.8s Failed to build iOS app Error output from Xcode build: ↳ 2022-06-11 01:52:58.729 xcodebuild[29723:234875] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore 2022-06-11 01:52:58.730 xcodebuild[29723:234875] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore ** BUILD FAILED ** Xcode's output: ↳ Writing result bundle at path: /var/folders/3n/66j3dtg939xg3sz7229460w40000gn/T/flutter_tools.o0iQn1/flutter_ios_build_temp_dirURZJhA/temporary_xcresult_bundle Failed to package /Users/abderrahmanecharrade/Library/CloudStorage/OneDrive-Personal/03_Privat/05_Code/03_Flutter/mepcherry. Command PhaseScriptExecution failed with a nonzero exit code note: Using new build system note: Planning note: Build preparation complete note: Building targets in dependency order Result bundle written to path: /var/folders/3n/66j3dtg939xg3sz7229460w40000gn/T/flutter_tools.o0iQn1/flutter_ios_build_temp_dirURZJhA/temporary_xcresult_bundle Could not build the application for the simulator. Error launching application on iPhone 13 Pro Max. Exited
设备与运行环境版本
- macOS Monterey 12.4
- Flutter 3.0.1
- Xcode 13.4.1
- Visual Studio Code:Flutter扩展及代码编辑器均已更新至最新版本,所有组件均为最新状态,
flutter doctor检测结果如下:
❯ flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.0.1, on macOS 12.4 21F79 darwin-x64, locale en-DE) [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.2) [✓] IntelliJ IDEA Community Edition (version 2022.1.1) [✓] VS Code (version 1.68.0) [✓] Connected device (3 available) [✓] HTTP Host Availability • No issues found!
可疑配置
怀疑错误可能源于~/.zshrc文件配置,相关配置片段如下:
# Flutter Global Variable export PATH="$PATH:/Users/usr/webapp-tools/flutter/bin" export SDKROOT=$(xcrun -sdk iphoneos --show-sdk-path) export SDKROOT=$/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.5.sdk
提前感谢所有提供有效建议的朋友。
内容的提问来源于stack exchange,提问作者AbdoCherry
相关产品推荐
相关产品推荐

