最近自己打算寫一個(gè) Swift 的項(xiàng)目,之前都還好好的。今天進(jìn)行真機(jī)測(cè)試的時(shí)候報(bào)出了這樣的錯(cuò)誤:
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
在 Stack Overflow 上查了一下,發(fā)現(xiàn)是 CocoaPods 的問題。并且找到了幾種解決方法:
- clean 一下,重新調(diào)試就好了。
- 更改一下設(shè)置,改成『Yes』,之后clean一下。(我就是通過這個(gè)方法弄好的)
-
project 中在 Runpath Search Paths 添加 @executable_path/Frameworks
如果還有什么其他的解決方案,希望能夠分享~

