xcode14 iOS12以下系统运行崩溃问题libswiftCoreGraphics

问题描述:
更新到xcode14以后,在iOS12以下运行报错dyld: Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib
xcode 14.0.1
真机 iOS11.4

dyld: Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib
  Referenced from: /private/var/containers/Bundle/Application/813F8AB4-1A94-43F2-B1B3-980BE4FB3B40/xxx.app/Frameworks/Lottie.framework/Lottie
  Reason: image not found

解决办法:
如果是工程报错:
target -> Build Phases -> Link Binary With Libraries中添加:libswiftCoreGraphics.tbd
或者
target -> Build Settings -> OtherLinkFlags 添加: -Wl,-weak-lswiftCoreGraphics

image.png

如果是pod引入的库报错,例如SnapKit、Lottie(三种方法任选其一,前两者和工程报错一样):
①在pod中找到对应的target -> General -> Link Binary With Libraries中添加:libswiftCoreGraphics.tbd
②在pod中找到对应的target -> Build Settings -> OtherLinkFlags 添加: -Wl,-weak-lswiftCoreGraphics


image.png

③将库改成手动引入

官方回答参考
https://developer.apple.com/forums/thread/714795

你可能感兴趣的:(xcode14 iOS12以下系统运行崩溃问题libswiftCoreGraphics)