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.

Same issue here. Xcode 14.0 + iOS12.0. Termination Description: DYLD, Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib

No problems with Xcode 13.4.1 + iOS12.0

Accepted Answer

If you run your app from the Home screen on the 10.3.3 device, does it crash? If so, please grab the resulting crash report and post it here.

For advice on how to post your crash report, see Posting a Crash Report.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

We're observing the same issue on Xcode 14 iOS 12.1.4. No crash if deployed from Xcode 13

Facing the same issue. Will leave a reply with the details we have noticed so far.

We've been facing the same issue since the first Xcode Betas until the public release that we recently released.

I have tried creating a sample app with Xcode 14 and it does not happen with that, hence my suspicion is that there is something specific with our project that is causing the package produced by Xcode 14 to have this issue. The same project with Xcode 13 does not demonstrate this issue and the packages generated using that work fine on iOS versions below 12.2.

Error seen in Xcode console:

I have compared the binaries created by both Xcode 13.4 and 14 and following were my observations.

Command run: `otool -LD

With Xcode 13.3.1 (13E500a) when we search for the phrase libswiftCoreGraphics we notice only one occurrence.

With Xcode 14 when we search for the phrase libswiftCoreGraphics we notice two occurrences. With the /usr/lib/swift/ one being the same occurrence that Xcode shows in console.

Crash log from device:

DTS ticket ID: 101794668438

Feedback assistant: FB10905587

TSI ticket: 808801996

Sounds like the same issue as mentioned here.

I filed a feedback, FB11512459, but have not heard anything as of yet.

-Ryan

I am using Xcode 13.4.1 and the submitted app store version keeps crashing in iOS 9.3.5 and iOS 10+. but Adhoc builds working fine only App Store build getting crashing.

Dyld Error Message: Dyld Message: Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib Referenced from: /var/containers/Bundle/Application/85C5C95A-90F7-4B4C-B84A-93B92BD967CB/Magzter6.app/Magzter6 Reason: image not found Dyld Version: 390.7

Apple Feedback complaint No. : FB11515032 reported on Sep 15, 2022 at 11:08 AM

I have the same problem with app submitted to TestFlight and running on iOS10.3.4. using xCode 13.4.1 to build App run fine started from xCode (debug or release mode) on the device App run fine on device under iOS 15.7 even with TestFlight Problem is there since at least 01/09/2022

Feedback : FB11529856

This is the crash log for my 10.3.3 device

Can I please ask the question author to not mark it as accepted/resolved so that it does not affect the visibility of the issue?

I accidentally touched it. I can't cancel it yet

TSI ticket: 808801996

That’s been routed to one of my colleagues, so I’m going to defer to them in this matter.

vijaytholpadi, once you get an answer via that TSI, I’d appreciate you posting a summary here.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is this the same issue as mentioned here?

Almost certainly.

Since yesterday I’ve learnt more about this issue, although I still don’t have a full answer for you. All I can say right now is that, as far as we can tell, this is an issue on the Apple side of things (r. 100194032).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Crash from one of our users with: "Library not loaded: /usr/lib/swift/libswiftCoreData.dylib" Binary was built with Xcode 13.4.1. And we don't use CoreData at all.

It looks like an AppStore rebuilds app with bitcode using Xcode 14 toolchain. 🧐

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?

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