dyld:未加载库:@ rpath / libswiftCore.dylib [英] dyld: Library not loaded: @rpath/libswiftCore.dylib

查看:579
本文介绍了dyld:未加载库:@ rpath / libswiftCore.dylib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在iPhone 4s上运行Swift应用程序。它在模拟器上工作正常,我的朋友可以在他的iPhone 4s上成功运行它。我有iOS 8和Xcode 6的正式版本。

I am trying to run a Swift app on my iPhone 4s. It works fine on the simulator, and my friend can successfully run it on his iPhone 4s. I have iOS 8 and the official release of Xcode 6.

我试过了


  • 重新启动Xcode,iPhone,电脑

  • 清洁&重建

  • 撤销和创建新的证书/供应配置文件

  • 运行路径搜索路径是 $(继承)@ executable_path / Frameworks

  • 嵌入式内容包含Swift代码为'是'

  • 代码签名身份为开发人员

  • Restarting Xcode, iPhone, computer
  • Cleaning & rebuilding
  • Revoking and creating new certificate/provision profile
  • Runpath Search Paths is $(inherited) @executable_path/Frameworks
  • Embedded Content Contains Swift Code is 'Yes'
  • Code Signing Identity is developer

以下是完整错误

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


推荐答案

对我来说,以前的解决方案都没有奏效。我们发现Build Settings中有一个Always Embed Swift Standard Libraries标志,需要设置为YES。默认为NO!

For me none of the previous solutions worked. We discovered that there is an "Always Embed Swift Standard Libraries" flag in the Build Settings that needs to be set to YES. It was NO by default!

构建设置>始终嵌入Swift标准库

设置完成后,在再次构建之前清理项目。

After setting this, clean the project before building again.

为敏锐的读者提供一些解释
最重要的部分是:

For keen readers some explanation The most important part is:


在您的应用中将嵌入式内容包含Swift代码(EMBEDDED_CONTENT_CONTAINS_SWIFT)构建设置为YES,如图2所示。此构建设置指定目标产品是否嵌入了带有Swift代码的内容,当设置为YES时,Xcode会在应用程序中嵌入Swift标准库。

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.

该标志以前称为嵌入式内容包含Swift代码

这篇关于dyld:未加载库:@ rpath / libswiftCore.dylib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆