問題描述:
更新到xcode14以后溜歪,在iOS12以下運(yùn)行報(bào)錯dyld: Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib
xcode 14.0.1
真機(jī) 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
解決辦法:
如果是工程報(bào)錯:
target -> Build Phases -> Link Binary With Libraries中添加:libswiftCoreGraphics.tbd
或者
target -> Build Settings -> OtherLinkFlags 添加: -Wl,-weak-lswiftCoreGraphics
如果是pod引入的庫報(bào)錯,例如SnapKit舶得、Lottie(三種方法任選其一挖垛,前兩者和工程報(bào)錯一樣):
①在pod中找到對應(yīng)的target -> General -> Link Binary With Libraries中添加:libswiftCoreGraphics.tbd
②在pod中找到對應(yīng)的target -> Build Settings -> OtherLinkFlags 添加: -Wl,-weak-lswiftCoreGraphics
③將庫改成手動引入