dyld: Library not loaded: @rpath/libswiftCore.dylib

曾经写了一个swift项目 以前运行是好使的,今天突然真机运行,就报错了,然后我试一下模拟器 ,有好使了,然后我看了一下错误的原因,

大跌眼镜,错误如下:

dyld: Library not loaded: @rpath/libswiftCore.dylib

yld: 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

解决方向如下:

set the Embedded Content Contains Swift Code (EMBEDDED_CONTENT_CONTAINS_SWIFT) build setting to YES in your app as shown in Figure 2. This build setting, which specifies whether a target's product has embedded content with Swift code, tells Xcode to embed Swift standard libraries in your app when set to YES.




猜你喜欢

转载自blog.csdn.net/jq2530469200/article/details/52208686