我正在试着在我的iPhone 4s上运行Swift应用程序。它在模拟器上运行良好,我的朋友也可以在他的iPhone 4s上成功运行。我有iOS 8和官方发布的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

当前回答

对我来说什么都没用,然后我做了下面这些步骤:

我从podfile中删除了flipper的使用情况。在我看来是这样的: use_flipper !({Flipper-Folly”= >“2.5.3”,“鳍”= >“0.87.0”,“Flipper-RSocket ' = > ' 1.3.1 '}) 我在我的项目中添加了一个swift文件来创建一个桥接头。

其他回答

我在运行Swift测试时遇到了这个问题(但不是我的应用程序)。事实证明,测试需要在测试目标的Runpath Search Paths构建设置中有更多的@executable_path/Frameworks。以下设置Runpath搜索路径对我来说很有魅力:

$(inherited)
@executable_path/Frameworks
@loader_path/Frameworks

我认为直接从Xcode生成证书是一个错误。要解析(至少在Xcode 6.1 / 6A1052d中):

go to the Apple Developer website where certificates are managed: https://developer.apple.com/account/ios/certificate/certificateList.action select your certificate(s) (which should show "Managed by Xcode" under "Status") and "Revoke" it follow instructions here to manually generate a new certificate: https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html#//apple_ref/doc/uid/TP40012582-CH31-SW32 go to Xcode > Preferences > Accounts > [your Apple ID] > double-click your team name > hit refresh button to update certificates and provisioning profiles

我在Xcode 13和iOS 12手机中也得到了完全相同的错误。

这里我的项目部署信息是12.0,但我的框架部署信息在iOS 15.0。

我已经将我的框架部署信息更改为12.0。

结论:

这意味着框架和项目支持的版本问题。我们需要在创建框架后修复框架的最低支持版本。

我在Xcode 11中使用的是通用->框架,库和嵌入式内容,并将框架的“嵌入”选项更改为“嵌入&签名”

这个问题在Xcode 10.2中再次出现。您必须从Apple下载并安装以下软件包。它为命令行工具提供了Swift 5运行时支持。

https://support.apple.com/kb/DL1998?locale=en_US