Xcode 16 和 iOS 18 项目无法编译

问题描述 投票:0回答:1

我最近更新了 Xcode 和 MacOS,从那时起就无法在 iOS 设备/模拟器上编译我的 Flutter 应用程序。每次运行它时,错误都会不断变化,但这是运行后终端中的输出之一

flutter run

Uncategorized (Xcode): Command SwiftGeneratePch emitted errors but did not return a nonzero exit code to
indicate failure


Error (Xcode): no such file or directory:
'/Users/chiragbhansali/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation'


Error (Xcode): stat cache file
'/Users/chiragbhansali/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.0-22A3362-
db63dc9361471f152f572502bdbfe70a.sdkstatcache' not found


Error (Xcode): unable to rename temporary
'/Users/chiragbhansali/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/3F9VRK3CXAUUD/UIKit-1KHQ7M05IF
VXC-56601391.pcm.tmp' to output file
'/Users/chiragbhansali/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/3F9VRK3CXAUUD/UIKit-1KHQ7M05IF
VXC.pcm': 'No such file or directory'


Error (Xcode): could not build module 'UIKit'
/Users/chiragbhansali/Chirag/Coding/Projects/app/test/build/ios/Debug-iphonesimulator/Flutter.framewo
rk/Headers/FlutterAppDelegate.h:7:8


Error (Xcode): could not build module 'Flutter'
/Users/chiragbhansali/Chirag/Coding/Projects/app/test/ios/Runner/GeneratedPluginRegistrant.h:9:8


Error (Xcode): failed to emit precompiled header
'/Users/chiragbhansali/Library/Developer/Xcode/DerivedData/Runner-eifcguceazlwumgsyzegclqdrbqt/Build/Intermed
iates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_PB6A5GFLTNPC-clang_3F9VRK3CXAUUD.pch' for
bridging header
'/Users/chiragbhansali/Chirag/Coding/Projects/app/test/ios/Runner/Runner-Bridging-Header.h'


Uncategorized (Xcode): Command PrecompileSwiftBridgingHeader emitted errors but did not return a nonzero exit
code to indicate failure


Uncategorized (Xcode): Command SwiftEmitModule failed with a nonzero exit code


Uncategorized (Xcode): Command SwiftCompile failed with a nonzero exit code


Could not build the application for the simulator.
Error launching application on iPhone 16 Pro.

enter image description here

到目前为止我尝试过的:

  • 删除iOS SDK和模拟器
  • 使用
    cmd+shift+k
  • 清理 Xcode 构建缓存
  • 创建一个新的 Flutter 项目并尝试编译它(它失败了,因此减少了出现 Flutter 问题的可能性)
  • 清除 DerivedData 文件夹
  • 清除模拟器的设置和缓存
  • 重新启动笔记本电脑

版本:

  • Xcode:16.0
  • iOS:18.0
  • MacOS:15.1(也不适用于 15.0)
  • 颤动:3.24
ios swift flutter xcode
1个回答
0
投票

我也有同样的问题

在 iPhone 15 Pro Max 上以调试模式启动 lib/main.dart... 运行 pod install...17.4s 运行 Xcode 构建...
Xcode 构建完成。 40.9秒 无法构建 iOS 应用程序 错误(Xcode):没有这样的文件或目录:'/Users/rensithudaragonalagoda/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation'

错误(Xcode):统计缓存文件 找不到“/Users/rensithudaragonalagoda/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.0-22A3362-db63dc9361471f152f572502bdbfe70a.sdkstatcache”

无法为模拟器构建应用程序。 在 iPhone 15 Pro Max 上启动应用程序时出错。

© www.soinside.com 2019 - 2024. All rights reserved.