在 Github 上下载的 SVGKit, 运行之后获取到 *SVGKit.framework *和 CocoaLumberjack.framework, 将这两个 framework 包拖入工程的 frameworks 目录下, 按照提示的各种配置处理好后, 一切OK, 编译成功, 开始运行, 结果在期待中, 应用加载到启动页就却报错啦.
报错的断点如图:

后台打印的错误:
dyld: Library not loaded: @rpath/SVGKit.framework/SVGKit
Referenced from: /var/containers/Bundle/Application/9F653402-2CE7-4B3B-A015-086FE3D54D18/e-contract-tourist.app/e-contract-tourist
Reason: image not found
瞬间蒙了, 在网上查了半天, 各种相似错误, 但是都不能解决我这个问题.
最后经过我的不懈努力, 终于搞定了, 现在把解决方法粘贴如下:
首先在 Build Phases 里添加 Copy Files

接着把 Destination 改成 Frameworks, 并将拖入的 framework 包加入到 Name 目录下:

再次运行, 就不会再报错啦.
在导入 framework 包的时候, 出现相同的这个错误都可以这么处理.
网友评论