iOS dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /var/containers/Bundle/A...

需求:重新更新项目,编译时候显示bug如下

dyld: Library not loaded: @rpath/libswiftCore.dylib
** Referenced from: /var/containers/Bundle/Application/43ADEA88-8A5A-4ACF-A95E-E4C81E80363D/BaskSharing.app/BaskSharing**
** Reason: no suitable image found. Did find:**
** /private/var/containers/Bundle/Application/43ADEA88-8A5A-4ACF-A95E-E4C81E80363D/BaskSharing.app/Frameworks/libswiftCore.dylib: mmap() errno=1 validating first page of '/private/var/containers/Bundle/Application/43ADEA88-8A5A-4ACF-A95E-E4C81E80363D/BaskSharing.app/Frameworks/libswiftCore.dylib'**

解决方法有两种把

第一种(亲测有效)

1.在targets->build settings,搜索runpath search paths ,增加一个@executable_path/Frameworks

2.如果原来就有这个条目,删除重新添加下,记得clean下项目

3.target - > build settings - > embedded content contains swift code ,此条目apple 默认是不开启的,如果上面方法还是不能解决的话,就把这个条目设置成YES,
改好之后,clean 一下再重新 build。


image.png
第二种(亲测有效)

动态库要添加引用签名,不然也是找不到资源库路径


image.png

你可能感兴趣的:(iOS dyld: Library not loaded: @rpath/libswiftCore.dylib Referenced from: /var/containers/Bundle/A...)