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

查看:42
本文介绍了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、电脑
  • 清洁&重建
  • 撤销和创建新的证书/配置文件
  • 运行路径搜索路径为 $(inherited) @executable_path/Frameworks
  • 嵌入的内容包含 Swift 代码为是"
  • 代码签名身份是开发人员

以下是错误的全部

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.

对于敏锐的读者一些解释最重要的部分是:

在您的应用程序中将 Embedded Content Contains Swift Code (EMBEDDED_CONTENT_CONTAINS_SWIFT) 构建设置设置为 YES,如图 2 所示.此构建设置指定目标的产品是否已使用 Swift 代码嵌入内容,告诉 Xcode 嵌入 Swift 标准库在您的应用中设置为 YES 时.

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.

该标志以前称为Embedded Content Contains Swift Code

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

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