Xcode 8 错误 dyld: Library not loaded: @rpath/libswiftCore.dylib 解决办法

用Xcode 8真机调试时,出现下面的错误:
dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /private/var/mobile/Containers/Bundle/Application/LONGSERIALNUMBER/AppName.app/AppName
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/LONGSERIALNUMBER/AppName.app/Frameworks/libswiftCore.dylib: mmap() error 1 at
address=0x008A1000, size=0x001A4000 segment=__TEXT in Segment::map() mapping
/private/var/mobile/Containers/Bundle/Application/LONGSERIALNUMBER/APPLICATION_NAME/Frameworks/libswiftCore.dylib

解决办法:前往文件夹:~/Library/Developer/Xcode/DerivedData,删除DerivedData文件夹中的所有文件,clean一下,重新运行Xcode。
说明:至于什么原因,不是很清楚,看错误的类型,应该是搭载Swift的静态库出编译时出问题了。

你可能感兴趣的:(xcode,library)