[Flutter] IOS Simulator가 실행 안되는 에러 (Could not build the application for the simulator.) android는 문제 없이 실행되는데 IOS만 실행 안될 때
VS Code로 Flutter 프로젝트를 만들고, 실행할때 android에서는 문제가 없이 실행이 되나 IOS에서만 에러가 발생할 때가 있다.
나중을 위해 메모 한다.
이부분을 확인하기 위해 여러군데 검색을 했었다. 이때, flutter와 xcode의 버전이 맞지 않아서 발생하는 문제라고 생각했었는데, 그렇지 않았었기에, 방법을 작성한다.
이럴 때 기본적으로 Xcode 캐시 완전 제거한다던가의 행위들은 모두 했었으나 해결이 되지 않았었고, Xcode의 Drived Data를 변경하고 해결했다.
1. (결론 먼저!!) 해결한 방법
Xcode를 실행. Xcode > Setting 클릭
Loation을 클릭하고, Drived Data를 변경해주면 된다.
라고 되어 있던것을 아래와 같이 다른 폴더로 변경
이렇게 하고 나면 놀랍게도 잘 실행이 된다.
아래 사이트틀을 참고해보니 이런 케이스들이 종종 있나보다.(나의 경우, 버전 업데이트를 하고 나서 발생한 현상이었음)
그리고 댓글중에는, ModuleCache.noindex를 생성해서 해결되었다는 글도 있었다.
https://github.com/flutter/flutter/issues/164729
Can't launch on iOS Simulator after updating Xcode: Error (Xcode): no such file or directory: · Issue #164729 · flutter/flutte
Steps to reproduce Setup flutter project iOS Build Run in a simulator Expected results It was working last week but after I updated the xcode as stable version and also updating ios sdk to ios 13 I...
github.com
2. 주로 발생했었던 에러 메세지들
났던 에러메세지를 전부 저장하고 있지는 않고, 최근에 났던것들만을 혹시 몰라 작성한다.
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/shownote/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation'
Error (Xcode): stat cache file '/Users/shownote/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-07b28473f605e47e75261259d3ef3b5a.sdkstatcache' not found
Error (Xcode): unable to rename temporary '/Users/shownote/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/1QOPLZ3HJICL2/DarwinFoundation-24M1U7WDMV3T2-4af4e7a1.pcm.tmp' to output file '/Users/shownote/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/1QOPLZ3HJICL2/DarwinFoundation-24M1U7WDMV3T2.pcm': 'No such file or directory'
Error (Xcode): could not build module 'DarwinFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/types.h:71:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:17:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/signal.h:147:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/_stdio.h:420:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/wait.h:88:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/resource.h:82:9
Error (Xcode): could not build module 'sys_wait'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/_stdlib.h:65:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/_string.h:151:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/_time.h:68:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/util.h:62:9
Error (Xcode): could not build module '_stdio'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/unistd.h:121:9
Error (Xcode): could not build module '_time'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/select.h:75:9
Error (Xcode): could not build module '_time'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/gethostuuid.h:31:9
Error (Xcode): could not build module '_stdio'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/stdio.h:60:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/nl_types.h:44:9
Error (Xcode): could not build module '_time'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/time.h:62:9
Error (Xcode): could not build module 'Darwin'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/dispatch/dispatch.h:27:9
Error (Xcode): could not build module 'Darwin'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/os/object.h:27:9
Error (Xcode): could not build module '_stdlib'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/stdlib.h:57:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/os/workgroup_base.h:7:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:5:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:27:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:17:9
Error (Xcode): could not build module 'os_object'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/xpc/xpc.h:5:9
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:7:8
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:11:9
Error (Xcode): could not build module 'CoreGraphics'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImageDefines.h:16:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h:23:9
Error (Xcode): could not build module 'Darwin'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h:34:9
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h:7:9
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h:7:8
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h:15:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h:13:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h:15:9
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/Symbols.framework/Headers/Symbols.h:7:8
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h:7:8
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/NSString+UserNotifications.h:7:8
Error (Xcode): could not build module 'UIKit'
/Users/shownote/dev_project/flutter/test_project/build/ios/Debug-iphonesimulator/Flutter.framework/Headers/FlutterAppDelegate.h:7:8
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBase.h:167:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioBaseTypes.h:17:9
Error (Xcode): could not build module 'CoreAudioTypes'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:3:9
Error (Xcode): could not build module 'Flutter'
/Users/shownote/dev_project/flutter/test_project/ios/Runner/GeneratedPluginRegistrant.h:9:8
Error (Xcode): failed to emit precompiled header '/Users/shownote/Library/Developer/Xcode/DerivedData/Runner-byedrtnxprdpiwfbiltjydwkdtbd/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_19ZJIVTRLT840-clang_1QOPLZ3HJICL2.pch' for bridging header '/Users/shownote/dev_project/flutter/test_project/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
Swift Compiler Error (Xcode): No such file or directory: '/Users/shownote/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation'
Swift Compiler Error (Xcode): Stat cache file '/Users/shownote/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-07b28473f605e47e75261259d3ef3b5a.sdkstatcache' not found
Swift Compiler Error (Xcode): Clang importer creation failed
Could not build the application for the simulator.
Error launching application on iPhone 15.
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/shownote/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation'
Error (Xcode): stat cache file '/Users/shownote/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-07b28473f605e47e75261259d3ef3b5a.sdkstatcache' not found
Error (Xcode): unable to rename temporary '/Users/shownote/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/1QOPLZ3HJICL2/DarwinFoundation-24M1U7WDMV3T2-4af4e7a1.pcm.tmp' to output file '/Users/shownote/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/1QOPLZ3HJICL2/DarwinFoundation-24M1U7WDMV3T2.pcm': 'No such file or directory'
Error (Xcode): could not build module 'DarwinFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/types.h:71:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:17:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/signal.h:147:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/_stdio.h:420:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/wait.h:88:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/resource.h:82:9
Error (Xcode): could not build module 'sys_wait'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/_stdlib.h:65:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/_string.h:151:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/_time.h:68:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/util.h:62:9
Error (Xcode): could not build module '_stdio'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/unistd.h:121:9
Error (Xcode): could not build module '_time'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/sys/select.h:75:9
Error (Xcode): could not build module '_time'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/gethostuuid.h:31:9
Error (Xcode): could not build module '_stdio'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/stdio.h:60:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/nl_types.h:44:9
Error (Xcode): could not build module '_time'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/time.h:62:9
Error (Xcode): could not build module 'Darwin'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/dispatch/dispatch.h:27:9
Error (Xcode): could not build module 'Darwin'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/os/object.h:27:9
Error (Xcode): could not build module '_stdlib'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/stdlib.h:57:9
Error (Xcode): could not build module 'sys_types'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/os/workgroup_base.h:7:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:5:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:27:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:17:9
Error (Xcode): could not build module 'os_object'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/xpc/xpc.h:5:9
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:7:8
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:11:9
Error (Xcode): could not build module 'CoreGraphics'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreImage.framework/Headers/CoreImageDefines.h:16:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h:23:9
Error (Xcode): could not build module 'Darwin'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h:34:9
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/OpenGLES.framework/Headers/EAGL.h:7:9
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h:7:8
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h:15:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h:13:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h:15:9
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/Symbols.framework/Headers/Symbols.h:7:8
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/FileProvider.framework/Headers/NSFileProviderDomain.h:7:8
Error (Xcode): could not build module 'Foundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/UserNotifications.framework/Headers/NSString+UserNotifications.h:7:8
Error (Xcode): could not build module 'UIKit'
/Users/shownote/dev_project/flutter/test_project/build/ios/Debug-iphonesimulator/Flutter.framework/Headers/FlutterAppDelegate.h:7:8
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreMedia.framework/Headers/CMBase.h:167:9
Error (Xcode): could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreAudioTypes.framework/Headers/CoreAudioBaseTypes.h:17:9
Error (Xcode): could not build module 'CoreAudioTypes'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:3:9
Error (Xcode): could not build module 'Flutter'
/Users/shownote/dev_project/flutter/test_project/ios/Runner/GeneratedPluginRegistrant.h:9:8
Error (Xcode): failed to emit precompiled header '/Users/shownote/Library/Developer/Xcode/DerivedData/Runner-byedrtnxprdpiwfbiltjydwkdtbd/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_19ZJIVTRLT840-clang_1QOPLZ3HJICL2.pch' for bridging header '/Users/shownote/dev_project/flutter/test_project/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
Swift Compiler Error (Xcode): No such file or directory: '/Users/shownote/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation'
Swift Compiler Error (Xcode): Stat cache file '/Users/shownote/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-07b28473f605e47e75261259d3ef3b5a.sdkstatcache' not found
Swift Compiler Error (Xcode): Clang importer creation failed
Could not build the application for the simulator.
Error launching application on iPhone 15.
Launching lib/main.dart on iPhone 15 in debug mode...
Xcode build done. 12.4s
Failed to build iOS app
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//Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation'
Error (Xcode): stat cache file '/Users/shownote/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-07b28473f605e47e75261259d3ef3b5a.sdkstatcache' not found
Uncategorized (Xcode): Command PrecompileSwiftBridgingHeader emitted errors but did not return a nonzero exit code to indicate failure
Swift Compiler Error (Xcode): No such file or directory: '/Users/shownote/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation'
Swift Compiler Error (Xcode): Stat cache file '/Users/shownote/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-07b28473f605e47e75261259d3ef3b5a.sdkstatcache' not found
Swift Compiler Error (Xcode): Cannot find 'GeneratedPluginRegistrant' in scope
/Users/shownote/dev_project/flutter/test_project/ios/Runner/AppDelegate.swift:9:4
Could not build the application for the simulator.
Error launching application on iPhone 15.
Exited (1).
3. 해결이 되지 않았던 방법들
Xcode 캐시 완전 제거부터 Flutter iOS 설정 초기화등을 다 해보았지만 되지 않았었다.
3-1. Xcode 캐시 완전 제거
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Developer/Xcode/Archives
rm -rf ~/Library/Developer/Xcode/ModuleCache.noindex
rm -rf ~/Library/Developer/Xcode/SDKStatCaches.noindex
3-2. 시뮬레이터 리셋
xcrun simctl shutdown all
xcrun simctl erase all
3-3. Flutter iOS 설정 초기화
flutter clean
rm ios/Podfile.lock pubspec.lock
rm -rf ios/Pods ios/.symlinks ios/Flutter/Flutter.framework
flutter pub get
cd ios
pod install
cd ..
3-4. 여담..
그동안 저 에러가 발생해서 ChatGPT에 여러번 질문 했었지만 3번의 해결되지 않는 방법들과 Xcode재설치등의 설명만을 받았었는데, 해결하니 너무 속시원하다.