0

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:

  1. Attempted to remove some debug configurations in the scheme, such as MainThread checker and other parameters.

  2. Added the -weak_framework SwiftUICore flag in "Other Link Flags".

  3. 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```
New contributor
du wt is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
2
  • What is your app's main target's name, is it "App" ? Commented 2 days ago
  • Similar question on the Apple developer forum Commented 2 days ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.