xcode14:Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib

Xcode13.4.1 is running properly, but after upgrading Xcode14, the debugging device reports an error: Library not loaded: / usr/lib/swift/libswiftCoreGraphics dylib, I according to the online solutions are tried, can't solve my problem, problem is ios10.3.3 equipment, unable to debug, also is unable to start the application success after packaging, Is this a problem with xcode14 itself?

Answered by DTS Engineer in 733147022

The underlying issue creating these crashes on older OS versions is resolved in Xcode 14.1 RC, available today. For apps built using any version Xcode 14 prior to Xcode 14.1 RC, and experiencing a crash at any point in the app's lifecycle — during debugging or after release to your customers, you can resolve this crash by rebuilding your app with Xcode 14.1 RC, and if your app was released to customers who are then experiencing the crash, releasing an update built with Xcode 14.1 RC to the App Store. You can remove any prior workarounds used to mitigate the crashes.

If your app experienced this crash after uploading to the App Store using Xcode 13 with bitcode enabled, your app experienced the crash due to the App Store processing your app's bitcode with the latest available release of Xcode, which was Xcode 14. Once Xcode 14.1 is released, the App Store's processing of bitcode moves forward to Xcode 14.1 as the latest Xcode release, so your app with bitcode will no longer be affected. However, since bitcode is deprecated starting with Xcode 14, you can also leave the prior workaround in place, disabling bitcode for the app entirely.

If you continue to get any remaining crashes after updating your app per the above advice, please let us know through Feedback Assistant and by sharing the FB number here.

Followed @Ptit-Xav's recommends and. its worked for me. App working iOS 9 . check its comments

Seems that xCode 13.4.1 can not distribute for pre iOS11( this can be checked in TestFlight). Even if debug is still possible. The only workaround I found was using xCode 13.4 and doing some extra configuration :

Build Settings / deployment / oAlways Embed Swift Libraries = Yes Build Settings / deployment / strip swift symbol = No Also when uploading : unselect 2 first options about BitCode and Strip Swift Symbols Tested successfully with iPhone 5 iOS 10.3.4 In the release notes of xCode it is not always easy to determine the lowest supported iOS version. New xCode 14 suppressed iOS10 and below support : it means all non 64 bits processor devices not supported. Debug is no more possible.

-- Comments from @Ptit-Xav

I meet the problem too. I use xcode 14 and run to iphone 11.2 , and my app crashes when runs. The crash log is " dyld: Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib Referenced from: /var/containers/Bundle/Application/aaaaa/bbbb.app/bbbb Reason: image not found" And I resloved it by set weak link to "buildsettings- Other Linker Flags", like this:-Wl,-weak-lswiftCoreGraphics -Wl,-rpath,/usr/lib/swift

We've been looking into this issue, and it took some time to understand the different scenarios presented by the crashes you are reporting involving CoreGraphics, Foundation, and CoreData. Thank you to those who filed bug reports in Feedback Assistant, provided full crash reports here on the forums, and filed Technical Support Incidents.

There is a single underlying issue which affects the Swift runtime support for OS versions prior to the addition of the Swift runtime as a library provided by the operating system This issue is then manifested as a crash through 2 different paths.

  1. If you are building your app with any version of Xcode 13 and submit these builds to the App Store, your app downloaded from the App Store will crash with a missing library error when run on iOS 9 - 12.1. You can avoid this crash by disabling bitcode in your app's build settings, rebuilding your app, and submitting an update to the App Store. In general, you are able to build and test your app on these iOS versions directly from Xcode without being affected.

  2. If you are building your app with Xcode 14 or Xcode 14.0.1, your app will crash on older OS versions, including while building and testing directly from Xcode, as well as after submitting the app to the App Store. The OS versions affected include iOS 11 - 12.1, macOS 10.13 - 10.14.3, as well as watchOS and tvOS versions from the same time frame. To work around the crash when building with Xcode 14, add -Wl,-weak-lswiftCoreGraphics (substituting other library names for swiftCoreGraphics if appropriate for your crash) to the Other Linker Flags build setting.

To verify the workaround for the second scenario, inspect the binary with otool -L /Path/To/Binary before and after applying this setting. Before applying this setting, you will see the Swift library referenced at /usr/lib/swift/libswiftCoreGraphics.dylib (again, substituting the appropriate library name given your crash report), and after applying this workaround, you should see that change to @rpath/libswiftCoreGraphics.dylib instead, which is what you want to see.

My situation is the same as yours. Xcode 13.4.1 runs and packages normally under iOS11 - iOS2.2, and crashed directly under Xcode 14. My solution is to make the following settings in each target (including Pods target) using Swift under Xcode14: General ->Frameworks and Libraries Add a reference to libswiftCoreGraphics.tbd, and it will be normal after re running and packaging

We have also been experiencing this issue. The workaround suggested by Apple did not fix everything, as our project - like many others - uses Cocoapods and other frameworks. Each of these needed to be updated as well, and the issue seemed to be resolved.

Is it even worth it to turn on bitcode nowadays? Is there any advantage left? Since bitcode is not supported anymore on Xcode 14.

Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib  Referenced from: /private/var/containers/Bundle/Application/***/***/Frameworks/SnapKit.framework/SnapKit

1.Build Setting ->Other Link Flags Add configuration -Wl,-weak-lswiftCoreGraphics; 2.If have cocopods,found the error framework like ” SnapKit.framework“ do the same Add configuration -Wl,-weak-lswiftCoreGraphics;

After multi-person testing, the crash problem can be solved

The underlying issue creating these crashes on older OS versions is resolved in Xcode 14.1 RC, available today. For apps built using any version Xcode 14 prior to Xcode 14.1 RC, and experiencing a crash at any point in the app's lifecycle — during debugging or after release to your customers, you can resolve this crash by rebuilding your app with Xcode 14.1 RC, and if your app was released to customers who are then experiencing the crash, releasing an update built with Xcode 14.1 RC to the App Store. You can remove any prior workarounds used to mitigate the crashes.

If your app experienced this crash after uploading to the App Store using Xcode 13 with bitcode enabled, your app experienced the crash due to the App Store processing your app's bitcode with the latest available release of Xcode, which was Xcode 14. Once Xcode 14.1 is released, the App Store's processing of bitcode moves forward to Xcode 14.1 as the latest Xcode release, so your app with bitcode will no longer be affected. However, since bitcode is deprecated starting with Xcode 14, you can also leave the prior workaround in place, disabling bitcode for the app entirely.

If you continue to get any remaining crashes after updating your app per the above advice, please let us know through Feedback Assistant and by sharing the FB number here.

We're facing quite similar issue.

Short brief of our situations:

  • we pushed app to appstore connect at 08.11.2022
  • app was built using Xcode 13.4.1 (Build version 13F100)
  • bitcode enabled

Based on latest feedback I understand that apps that are built using the XCode 13.x but published after the XCode 14.1 release should work fine. Anyway we're facing the crashes that occur on devices with iOS 11.x (11.1, 11.2.5)

Crashlog:

Incident Identifier: A0A546D9-A226-40FA-A274-D3F233CEDE5F
Hardware Model:      iPhone7,1
Process:             myapp [1156]
Path:                /private/var/containers/Bundle/Application/90DA7BAA-579C-471B-B0FF-39336888B2A8/myapp.app/myapp
Identifier:          com.myapp.app
Version:             1667918418 (9.6.1)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.myapp.app [480]


Date/Time:           2022-11-13 12:43:12.9491 +0700
Launch Time:         2022-11-13 12:43:12.4916 +0700
OS Version:          iPhone OS 11.2.5 (15D60)
Baseband Version:    6.30.04
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Description: DYLD, Library not loaded: /usr/lib/swift/libswiftCoreData.dylib | Referenced from: /var/containers/Bundle/Application/90DA7BAA-579C-471B-B0FF-39336888B2A8/myapp.app/myapp | Reason: image not found
Triggered by Thread:  0

Thread 0 Crashed:
0   dyld                          	0x00000001014d2f48 __abort_with_payload + 8
1   dyld                          	0x00000001014d271c abort_with_payload_wrapper_internal + 100 (terminate_with_reason.c:71)
2   dyld                          	0x00000001014d2748 abort_with_payload + 12 (terminate_with_reason.c:93)
3   dyld                          	0x00000001014a8498 dyld::halt(char const*) + 312 (dyld.cpp:3824)
4   dyld                          	0x00000001014ab714 dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, un... + 7376 (dyld.cpp:6202)
5   dyld                          	0x00000001014a521c _dyld_start + 68

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000006   x1: 0x0000000000000001   x2: 0x000000016f79a520   x3: 0x0000000000000092
    x4: 0x000000016f79a120   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000a60
    x8: 0x0000000000000020   x9: 0x0000000000000009  x10: 0x6c504b2f38413242  x11: 0x4b2f7070612e7375
   x12: 0x20200a73756c504b  x13: 0x203a6e6f73616552  x14: 0x6f6e206567616d69  x15: 0x00646e756f662074
   x16: 0x0000000000000209  x17: 0x000000008000001f  x18: 0xfffffff00f49925c  x19: 0x0000000000000000
   x20: 0x000000016f79a120  x21: 0x0000000000000092  x22: 0x000000016f79a520  x23: 0x0000000000000001
   x24: 0x0000000000000006  x25: 0x0000000100664000  x26: 0x00000001014e6000  x27: 0x00000001014e5f88
   x28: 0x000000016f79bb20   fp: 0x000000016f79a0f0   lr: 0x00000001014d271c
    sp: 0x000000016f79a0b0   pc: 0x00000001014d2f48 cpsr: 0x00000000

Binary Images:
0x100664000 - 0x100f1bfff myapp arm64  <570e.......

@edford Do you know maybe what's the status of the potential fix for the mentioned issue?

facing similar issue

Recently released the update of our app to appstore which is crashing in upgraded user device, fresh install is working fine. Latest build is from xcode14, older build was in xcode 13.. Frustrating crash happens only in app store not in testflight for the same build. Crash happens in application didfinish launching options as soon as the application is opened. Some one help what could be the cause please

Facing the same issue, any ideas or updates?

Same here. I compile a xcframework with Xcode 14.2 and depending on the device I run, it crashes or not...

Any updates please?

Yes please any update? Compiling a xcframework with Xcode 14.2 or 14.3 and it crashes depending on the device I run too. It's really not consistent and really annoying!

I have a similar issue with running Xcode 15 built app on iOS 16.6.1. The app runs fine on iOS 17.0.2, but crashes on launch on older version of iOS - did not have this issue with older versions of Xcode

dyld[26192]: Symbol not found: _$sSo24OS_dispatch_queue_serialC8DispatchE5label3qos10attributes20autoreleaseFrequency6targetABSS_AC0E3QoSVAbCE10AttributesVSo0a1_b1_C0CACE011AutoreleaseJ0OANSgtcfC
  Referenced from: <19E02EF7-C05C-3D62-88DC-AC4178A604FA> /private/var/containers/Bundle/Application/DBC3A9EB-A8F8-4AA4-B72C-C4C59D7C2B4E/Bank Greenwood.app/Bank Greenwood
  Expected in:     <E0BB294E-B630-379B-AAC8-D5C0A83A55E6> /usr/lib/swift/libswiftDispatch.dylib
xcode14:Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib
 
 
Q