当xcode跑OC没有问题,跑swift却出现一下这种问题时:
1.dyld`dyld_fatal_error:
-> 0x120071088 <+0>: brk #0x3
2.dyld: Library not loaded: @rpath/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,不过我的还是默认设置NO
网友评论
不要以为本来就有,没必要删除再添加!
好多坑啊。。。。。。。。。
Referenced from: /private/var/mobile/Containers/Bundle/Application/52108DA0-74D3-4BA2-B31F-73B68C892CA7/边锋德州.app/边锋德州
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/52108DA0-74D3-4BA2-B31F-73B68C892CA7/边锋德州.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x10179C000, size=0x00204000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/52108DA0-74D3-4BA2-B31F-73B68C892CA7/边锋德州.app/Frameworks/libswiftCore.dylib
/private/var/mobile/Containers/Bundle/Application/52108DA0-74D3-4BA2-B31F-73B68C892CA7/边锋德州.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x101BF4000, size=0x00204000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/52108DA0-74D3-4BA2-B31F-73B68C892CA7/边锋德州.app/Frameworks/libswiftCore.dylib