As the title suggests, I'm encountering the following issue: In a new project where SwiftUI is used as the main UI development component, the app crashes on launch in versions below iOS 17. The log is provided below. This issue does not occur in iOS 18 and above. So far, I have tried the following:
Attempted to remove some debug configurations in the scheme, such as MainThread checker and other parameters.
Added the
-weak_framework SwiftUICoreflag in "Other Link Flags".Removed DerivedData and cleared the project.
However, the error persists:
dyld\[1165\]: Library not loaded: /System/Library/Frameworks/SwiftUICore.framework/SwiftUICore
Referenced from: \<FCE4CA0D-7ED3-388B-B752-FD9FF406DE47\> /private/var/containers/Bundle/Application/7866F289-CDE4-437E-B3D8-829C2E9A5CDC/App.app/App.debug.dylib
Reason: tried: '/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file), '/private/preboot/Cryptexes/OS/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file), '/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file, not in dyld cache)
Library not loaded: /System/Library/Frameworks/SwiftUICore.framework/SwiftUICore
Referenced from: \<FCE4CA0D-7ED3-388B-B752-FD9FF406DE47\> /private/var/containers/Bundle/Application/7866F289-CDE4-437E-B3D8-829C2E9A5CDC/App.app/App.debug.dylib
Reason: tried: '/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file), '/private/preboot/Cryptexes/OS/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file), '/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file, not in dyld cache)
dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libLogRedirect.dylib:/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/usr/lib/libViewDebuggerSupport.dylib```