dyld:没有加载的库:@rpath/libswiftCore.dylib。

时间:2021-10-06 21:29:34

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.

我想在我的iPhone 4s上运行一个Swift应用程序。它在模拟器上运行良好,我的朋友可以在他的iPhone 4s上成功运行它。我有ios8和Xcode 6的官方版本。

I have tried

我有试过

  • Restarting Xcode, iPhone, computer
  • 重新启动Xcode,iPhone,电脑
  • Cleaning & rebuilding
  • 清理与重建
  • Revoking and creating new certificate/provision profile
  • 撤销并创建新的证书/提供配置文件。
  • Runpath Search Paths is $(inherited) @executable_path/Frameworks
  • Runpath搜索路径是$(继承的)@executable_path/框架。
  • Embedded Content Contains Swift Code is 'Yes'
  • 嵌入的内容包含Swift代码是“是”
  • Code Signing Identity is developer
  • 代码签名标识是开发人员。

Below is the error in entirety

下面是整个错误。

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

38 个解决方案

#1


448  

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!

对我来说,之前的解决方案都没有奏效。我们发现在需要设置为YES的构建设置中有一个“总是嵌入Swift标准库”的标志。这不是默认的!

Build Settings > Always Embed Swift Standard Libraries

Build Settings >总是嵌入Swift标准库。

After setting this, clean the project before building again.

设置完毕后,再在建筑物前清理。

For keen readers some explanation The most important part is:

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

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代码(嵌入ded_content_contains_swift),在应用程序中设置为YES,如图2所示。该构建设置指定目标产品是否嵌入了Swift代码的内容,并告诉Xcode在设置为YES时将Swift标准库嵌入到应用程序中。

dyld:没有加载的库:@rpath/libswiftCore.dylib。

The flag was formerly called Embedded Content Contains Swift Code

该旗帜以前称为嵌入式内容,包含Swift代码。

#2


95  

Surprisingly enough, all i did was "Clean" my project (shift+cmd+K) and it worked. Did seem to be related to the certificate though.

令人惊讶的是,我所做的只是“清理”了我的项目(shift+cmd+K),并且成功了。但似乎与证书有关。

#3


89  

I started getting this error when I removed:

当我删除时,我开始犯这个错误:

@executable_path/Frameworks

from Runpath Search Paths in my build settings. Replacing it fixed everything up again (thank goodness for source control!)

从我的构建设置的Runpath搜索路径。替换它重新修复所有的东西(谢天谢地,源代码控制!)

I don't know how it got there, but it appears to be needed for a binary to find its embedded Swift runtime.

我不知道它是如何实现的,但它似乎需要一个二进制文件来寻找它的嵌入式Swift运行时。

#4


46  

For the device, you also need to add the dynamic framework to the Embedded binaries section in the General tab of the project.dyld:没有加载的库:@rpath/libswiftCore.dylib。

对于该设备,您还需要将动态框架添加到项目的General选项卡中的嵌入式二进制部分。

#5


43  

In Xcode 8 the option for Embedded Content Contains Swift Code option is no longer available.

在Xcode 8中,嵌入内容的选项包含Swift代码选项不再可用。

It has been renamed to "Always Embed Swift Standard Libraries = YES"

它被重新命名为“总是嵌入Swift标准库= YES”。

dyld:没有加载的库:@rpath/libswiftCore.dylib。

#6


27  

I think it's a bug when certificates are generated directly from Xcode. To resolve (at least in Xcode 6.1 / 6A1052d):

当证书直接从Xcode生成时,我认为这是一个错误。解决(至少在Xcode 6.1 / 6A1052d):

  1. go to the Apple Developer website where certificates are managed: https://developer.apple.com/account/ios/certificate/certificateList.action
  2. 去苹果开发者网站,在那里可以管理证书:https://developer.apple.com/account/ios/certificate/certificateList.action。
  3. select your certificate(s) (which should show "Managed by Xcode" under "Status") and "Revoke" it
  4. 选择您的证书(该证书应该显示“由Xcode管理”的“状态”),并“撤销”它。
  5. 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
  6. 按照这里的指示,手动生成一个新的证书:https://developer.apple.com/library/ios/documentation/ides/conceptual/appdistributionguide/maintainingcertificate。html#//apple_ref/doc/uid/TP40012582-CH31-SW32。
  7. go to Xcode > Preferences > Accounts > [your Apple ID] > double-click your team name > hit refresh button to update certificates and provisioning profiles
  8. 去Xcode >偏好>账户>[你的苹果ID] >双击你的团队名称>点击刷新按钮来更新证书和配置文件。

#7


24  

OK, sharing here another cause of this error. It took me a few hours to sort this out.

在这里分享另一个错误的原因。我花了几个小时才整理好。

In my case the trust policy of my certificate in Keychain Access was Always Trust, changing it back to defaults solved the problem.

在我的情况下,我在Keychain访问中的证书的信任策略始终是信任,将其更改为默认值解决了问题。

In order to open the certificate settings window double click the certificate in the Keychain Access list of certificates.

为了打开证书设置窗口,双击证书的Keychain访问列表中的证书。

dyld:没有加载的库:@rpath/libswiftCore.dylib。dyld:没有加载的库:@rpath/libswiftCore.dylib。

#8


17  

I was having this issue with running my Swift tests (but not my app). It turns out that the test needed to have more than @executable_path/Frameworks in it's Runpath Search Paths build setting for the test target. Setting the Runpath Search Paths to the following worked a charm for me:

我在运行我的快速测试(但不是我的应用程序)时遇到了这个问题。事实证明,在它的Runpath搜索路径中,需要有超过@executable_path/框架的测试来构建测试目标。设置Runpath搜索路径到以下工作对我有吸引力:

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

#9


16  

I think Apple has already summarized it under Swift app crashes when trying to reference Swift library libswiftCore.dylib

我认为苹果已经在Swift应用程序崩溃的情况下总结了它,当它试图引用Swift的图书馆libswiftCore.dylib时。

Cited from Technical Q&A QA1886:

摘自《技术问答》QA1886:

Swift app crashes when trying to reference Swift library libswiftCore.dylib.

Swift应用程序崩溃时,试图引用Swift库libswiftCore.dylib。

Q: What can I do about the libswiftCore.dylib loading error in my device's console that happens when I try to run my Swift language app?

关于libswiftCore我可以做些什么?当我试图运行我的Swift语言应用程序时,我的设备控制台中的dylib装载错误发生了?

A: To correct this problem, you will need to sign your app using code signing certificates with the Subject Organizational Unit (OU) set to your Team ID. All Enterprise and standard iOS developer certificates that are created after iOS 8 was released have the new Team ID field in the proper place to allow Swift language apps to run.

你纠正这个问题,将需要签署应用程序使用代码签名证书的主题组织单元(OU)设置为您的团队ID。所有企业和标准iOS开发者证书后创建的iOS 8发布新团队ID字段在适当的地方,允许迅速语言应用程序运行。

Usually this error appears in the device's console log with a message similar to one of the following:

通常,该错误出现在设备的控制台日志中,其消息类似如下:

[....] [deny-mmap] mapped file has no team identifier and is not a platform binary:
/private/var/mobile/Containers/Bundle/Application/5D8FB2F7-1083-4564-94B2-0CB7DC75C9D1/YourAppNameHere.app/Frameworks/libswiftCore.dylib

Dyld Error Message:
  Library not loaded: @rpath/libswiftCore.dylib

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000120021088
Triggered by Thread: 0

Referenced from: /private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/TestApp
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x1001D8000, size=0x00194000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/Frameworks/libswiftCore.dylib
Dyld Version: 353.5

The new certificates are needed when building an archive and packaging your app. Even if you have one of the new certificates, just resigning an existing swift app archive won’t work. If it was built with a pre-iOS 8 certificate, you will need to build another archive.

在构建存档和打包应用程序时需要新的证书,即使您有新的证书,只需重新签下现有的swift应用程序存档就不行。如果它是使用预ios8证书构建的,则需要构建另一个存档。

Important: Please use caution if you need to revoke and setup up a new Enterprise Distribution certificate. If you are an in-house Enterprise developer you will need to be careful that you do not revoke a distribution certificate that was used to sign an app any one of your Enterprise employees is still using as any apps that were signed with that enterprise distribution certificate will stop working immediately. The above only applies to Enterprise Distribution certificates. Development certs are safe to revoke for enterprise/standard iOS developers.

重要:如果需要撤销和设置新的企业分发证书,请使用警告。如果你是一个内部企业开发人员你需要小心,你不撤销一个分布证书用于签署一项应用任何一个企业的员工仍在使用任何应用程序,签署了与企业分配证书将立即停止工作。以上仅适用于企业发行证书。开发证书对于企业/标准的iOS开发人员来说是安全的。

As the AirSign guys state the problem roots from the missing OU attribute in the subject field of the In-House certificate.

正如AirSign的人指出问题的根源是在内部证书的主题字段中缺失的OU属性。

Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, OU=269J2W3P2L, O=Company Name, C=FR

主题:UID=269J2W3P2L, CN=iPhone发行版:公司名,OU=269J2W3P2L, O=公司名称,C=FR。

I have an enterprise development certificate, creating a new one solved the issue.

#10


14  

You have to set the Runpath Search Paths to @executable_path/Frameworks as showed in the following screenshot of Build Settings:

您必须将Runpath搜索路径设置为@executable_path/框架,如下面的构建设置截图所示:

dyld:没有加载的库:@rpath/libswiftCore.dylib。

If you have any embedded frameworks made in Swift, than you can set to YES the Build Options Embedded Content Contains Swift Code.

如果你有任何嵌入的框架,在Swift中,你可以设置为YES,嵌入的内容包含Swift代码。

#11


10  

Let's project P is importing custom library L, then you must add L into

让我们项目P导入自定义库L,然后您必须将L添加进去。

P -> Build Phases -> Embed Frameworks -> +. That works for me.

P ->构建阶段->嵌入框架-> +。这适合我。

dyld:没有加载的库:@rpath/libswiftCore.dylib。

#12


7  

I was having the same problem after moving to a new mac, and after hours, trying all the suggested answers in the questions, none of this worked for me.

在搬到一个新的mac电脑后,我也遇到了同样的问题,在几个小时之后,我尝试了所有问题的答案,但这些都不适合我。

The solution for me was installing this missing certificate. http://developer.apple.com/certificationauthority/AppleWWDRCA.cer

我的解决方案是安装这个丢失的证书。http://developer.apple.com/certificationauthority/AppleWWDRCA.cer

Found the answer here. https://*.com/a/14495100/976628

找到了答案。https://*.com/a/14495100/976628

#13


6  

Change Copy Pods Resources for the target from:

为目标更改复制pod资源:

"${SRCROOT}/Pods/Target Support Files/Pods-Wishlist/Pods-Wishlist-resources.sh"

to:

:

"${SRCROOT}/Pods/Target Support Files/Pods-Wishlist/Pods-Wishlist-frameworks.sh"

#14


6  

I solved by deleting the derived data and this time it worked correctly. Tried with Xcode 7.3.1GM

我通过删除派生数据解决了这个问题,这一次它工作正常。尝试与Xcode 7.3.1GM

#15


4  

In my case, it was just the name of my target :

在我的案例中,这只是我的目标的名字:

I renamed it like this : MyApp.something and the same issue appeared. But I saw in the build Settings window, my product module name has been changed like this MyApp-something. So, I removed the dot in my target name (MyAppSomething) and the issue was gone.

我把它重新命名为:MyApp。出现了同样的问题。但是我在build Settings窗口中看到,我的产品模块名称已经像这个myapp一样被改变了。因此,我删除了目标名称中的点(MyAppSomething),这个问题就消失了。

#16


4  

For me, having tried everything with no success, what worked was to remove @executable_path/Frameworks from the Packaging section (don't know how it came to be in there in the first place)

对我来说,尝试了所有没有成功的东西之后,我的工作是将@executable_path/框架从打包部分删除(不知道它是如何在第一个地方出现的)

dyld:没有加载的库:@rpath/libswiftCore.dylib。

#17


4  

After having tried out everything, I finally found out, that the build seems not always include every detail again and again. Maybe for speeding up the process... In order to ensure WHOLE packaging before running on a device, make a Clean first: Shift-Cmd-K. Then build with: Cmd-B. After that run it on your device. Easy. Kind regards to all you nice guys in that place!

在尝试了一切之后,我终于发现,构建似乎并不总是一次又一次地包含每个细节。也许是为了加速这个过程……为了确保在设备上运行之前的整个包装,首先要做一个干净的:Shift-Cmd-K。然后构建:Cmd-B。然后在你的设备上运行它。一件容易的事。向你在那个地方的好男人致以亲切的问候!

#18


4  

None of the solutions worked for me. Restarting the phone fixed it. Strange but it worked.

这些解决方案都不适合我。重启手机修好了。奇怪的但它工作。

#19


3  

none of these solutions seemed to work but when I changed the permission of the world Wide Developer cert to Use System defaults then it worked. I have included the steps and screenshots in the link below

这些解决方案似乎都没有奏效,但是当我改变了世界范围的开发者cert使用系统默认值的权限时,它就成功了。我已经包括了下面链接的步骤和截图。

I would encourage you to log the ticket in apple bug report as mentioned here as Apple really should solve this massive error: https://*.com/a/41401354/559760

我建议您在apple bug报告中记录下这张罚单,因为苹果确实应该解决这个巨大的错误:https://*.com/a/41401354/559760。

#20


2  

Xcode 7.2, iOS 9.2 on one device, 9.0 on other. Both had the error. No idea what changed that caused it, but the solutions above for the WWDR were correct for me. Install that cert and problem solved.

Xcode 7.2, ios9.2在一个设备上,9.0在另一个设备上。都有错误。不知道是什么导致了它,但是WWDR上面的解决方案对我来说是正确的。安装证书,解决问题。

https://forums.developer.apple.com/message/43547 https://forums.developer.apple.com/message/84846

https://forums.developer.apple.com/message/43547 https://forums.developer.apple.com/message/84846

#21


2  

There are lot's of answers there but might be my answer will help some one.

这里有很多的答案,但我的答案可能会帮助一些人。

I am having same issue, My app works fine on Simulator but on Device got crashed as I Lunches app and gives error as above. I have tried all answers and solutions . In My Case , My Project I am having multiple targets .I have created duplicate target B from target A. Target B works fine while target A got crashed. I am using different Image assets for each target. After searching and doing google I have found something which might help to someone.

我也有同样的问题,我的应用程序在模拟器上运行良好,但在我的午餐应用程序中,设备崩溃了,并给出了上面的错误。我已经尝试了所有的答案和解决方案。在我的案例中,我的项目有多个目标,我已经从目标A中创建了一个重复的目标B。我为每个目标使用不同的图像资产。在搜索和做谷歌之后,我发现了一些可能对某人有帮助的东西。

App stop crashing when I change name of Launch images assets for both apps . e.g Target A Launch Image asset name LaunchImage A . Target B Lunch Image asset name LaunchImage B and assigned properly in General Tab of each target . My Apps works fine.

当我更改了两个应用程序的启动图像资产名称时,应用程序停止崩溃。e。目标A启动图像资产名称LaunchImage A。目标B午餐图像资产名称LaunchImage B,并在每个目标的General选项卡中正确分配。我的应用程序工作正常。

#22


1  

I'm using Xcode 8.3.3 and Xcode 9.2. The solution for me was to switch my default Xcode from 8 to 9 using Xcode Select:

我使用的是Xcode 8.3.3和Xcode 9.2。我的解决方案是使用Xcode选择将我的默认Xcode从8改为9:

$ xcode-select --print-path

xcode-select美元——print-path

$ sudo xcode-select -switch /Applications/Xcode-9.2.app

$ sudo xcode-select -switch / application /Xcode-9.2.app。

Edit: Actually what seemed to help here was that Xcode 9.2 used the derived data from Xcode 8.3.3. Not a solution but at least it allows me to move forward with my work.

编辑:实际上,似乎有帮助的是Xcode 9.2使用来自Xcode 8.3.3的派生数据。这不是一个解决方案,但至少它让我能够继续工作。

#23


0  

To add on to the Enterprise distribution cert solution: you can open Keychain and inspect the cert. If there is any red text saying the trust chain can't be verified or it being revoked, it WILL NOT WORK! On my computer, our distribution cert was showing as revoked even though the web portal showed it as still valid. We got a new distribution cert, which was green (valid) in Keychain, and this solved the issue.

要添加到企业分发证书解决方案:您可以打开Keychain并检查cert,如果有任何红色文本表示信任链不能被验证或被撤销,那么它将无法工作!在我的电脑上,尽管门户网站显示它仍然有效,但我们的分发证书却显示为被撤销。我们得到了一个新的分配证书,它在Keychain是绿色的(有效的),这就解决了这个问题。

#24


0  

The above solutions did not work for me. I fix the issue by the following steps:

以上的解决方案对我不起作用。我通过以下步骤来解决这个问题:

  1. I had to go to the phone (Settings > Profile) and delete the profiles that were in the phone(including all the apps associated with those profile/provisions).
  2. 我必须去电话(设置>配置文件),删除手机上的配置文件(包括所有与这些配置文件相关的应用程序)。
  3. After that, make sure that you download the apple provisions in xcode. Go to xcode settings > account and sign in into your apple developer account.
  4. 在此之后,请确保您下载了xcode中的apple条款。到xcode设置>帐户,并登录到你的苹果开发者帐户。

#25


0  

I'm using Xcode 7.2. If you tried all of above and the error still occurs, try deleting the old certificate from Keychain Access! It's such a pain to finally fix this.

我使用Xcode 7.2。如果您尝试了以上所有操作,并且仍然发生错误,请尝试从Keychain访问删除旧证书!最终解决这个问题真是痛苦。

#26


0  

In my case,

在我的例子中,

I have set @executable_path/Frameworks

我有设置@executable_path /框架

But I have to also set "Framework search paths"

但我还要设置"框架搜索路径"

$(PROJECT_DIR)/Frameworks

change as recursive

变化是递归

Which works for me.

这适合我。

#27


0  

When Xcode asks you to reset certs, you reset it. And the app can be run on actual device without crash with that error messages. Once this problem is fixed in one swift project. Other swift projects with this problem are fixed also.

当Xcode要求你重置证书时,你重置它。应用程序可以在实际设备上运行,而不会出现错误消息。一旦这个问题被固定在一个快速的项目中。其他有这个问题的swift项目也都是固定的。

I have struggled for these about half a day and I found that reset certs again and again in provisioning portal doesn't help.

我挣扎了半天,我发现在供应门户网站上重新设置certs并没有什么帮助。

#28


0  

I have multiple version of Xcode installed at the same time. The framework was built with a newer version of Xcode. The app that I tried to compile was with an older version of Xcode. When I cleaned and compiled both the framework and the app with the same version of Xcode then things worked.

我同时安装了多个版本的Xcode。框架是用新版本的Xcode构建的。我尝试编译的应用程序是使用旧版本的Xcode。当我用相同版本的Xcode来清理和编译这个框架和应用程序时,事情就顺利了。

#29


0  

In my case, one of my testing targets was working but the other one was not. It was giving the above error with a missing library or whatever. I compared the settings for both of the testing targets and found that one was missing the configuration for "Test Host", so I copied that from the working test target and it fixed my broken test target!

在我的案例中,我的一个测试目标是工作,而另一个不是。它给出了一个丢失的库或其他的错误。我比较了两个测试目标的设置,发现其中一个缺少“测试主机”的配置,所以我从工作测试目标中复制了这个,它修复了我的测试目标!

dyld:没有加载的库:@rpath/libswiftCore.dylib。

#30


0  

From the post of https://github.com/CocoaPods/cocoapods-integration-specs/pull/24/files, that mean swift.dylib need sign but failed. I failed even create a new swift project with cocoapod support.

从https://github.com/cocoapods/cocoapods-integrationspecs/pull/24/files,这意味着swift。dylib需要签名,但失败了。我甚至失败了,创建了一个新的swift项目,并提供了cocoapod支持。

#1


448  

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!

对我来说,之前的解决方案都没有奏效。我们发现在需要设置为YES的构建设置中有一个“总是嵌入Swift标准库”的标志。这不是默认的!

Build Settings > Always Embed Swift Standard Libraries

Build Settings >总是嵌入Swift标准库。

After setting this, clean the project before building again.

设置完毕后,再在建筑物前清理。

For keen readers some explanation The most important part is:

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

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代码(嵌入ded_content_contains_swift),在应用程序中设置为YES,如图2所示。该构建设置指定目标产品是否嵌入了Swift代码的内容,并告诉Xcode在设置为YES时将Swift标准库嵌入到应用程序中。

dyld:没有加载的库:@rpath/libswiftCore.dylib。

The flag was formerly called Embedded Content Contains Swift Code

该旗帜以前称为嵌入式内容,包含Swift代码。

#2


95  

Surprisingly enough, all i did was "Clean" my project (shift+cmd+K) and it worked. Did seem to be related to the certificate though.

令人惊讶的是,我所做的只是“清理”了我的项目(shift+cmd+K),并且成功了。但似乎与证书有关。

#3


89  

I started getting this error when I removed:

当我删除时,我开始犯这个错误:

@executable_path/Frameworks

from Runpath Search Paths in my build settings. Replacing it fixed everything up again (thank goodness for source control!)

从我的构建设置的Runpath搜索路径。替换它重新修复所有的东西(谢天谢地,源代码控制!)

I don't know how it got there, but it appears to be needed for a binary to find its embedded Swift runtime.

我不知道它是如何实现的,但它似乎需要一个二进制文件来寻找它的嵌入式Swift运行时。

#4


46  

For the device, you also need to add the dynamic framework to the Embedded binaries section in the General tab of the project.dyld:没有加载的库:@rpath/libswiftCore.dylib。

对于该设备,您还需要将动态框架添加到项目的General选项卡中的嵌入式二进制部分。

#5


43  

In Xcode 8 the option for Embedded Content Contains Swift Code option is no longer available.

在Xcode 8中,嵌入内容的选项包含Swift代码选项不再可用。

It has been renamed to "Always Embed Swift Standard Libraries = YES"

它被重新命名为“总是嵌入Swift标准库= YES”。

dyld:没有加载的库:@rpath/libswiftCore.dylib。

#6


27  

I think it's a bug when certificates are generated directly from Xcode. To resolve (at least in Xcode 6.1 / 6A1052d):

当证书直接从Xcode生成时,我认为这是一个错误。解决(至少在Xcode 6.1 / 6A1052d):

  1. go to the Apple Developer website where certificates are managed: https://developer.apple.com/account/ios/certificate/certificateList.action
  2. 去苹果开发者网站,在那里可以管理证书:https://developer.apple.com/account/ios/certificate/certificateList.action。
  3. select your certificate(s) (which should show "Managed by Xcode" under "Status") and "Revoke" it
  4. 选择您的证书(该证书应该显示“由Xcode管理”的“状态”),并“撤销”它。
  5. 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
  6. 按照这里的指示,手动生成一个新的证书:https://developer.apple.com/library/ios/documentation/ides/conceptual/appdistributionguide/maintainingcertificate。html#//apple_ref/doc/uid/TP40012582-CH31-SW32。
  7. go to Xcode > Preferences > Accounts > [your Apple ID] > double-click your team name > hit refresh button to update certificates and provisioning profiles
  8. 去Xcode >偏好>账户>[你的苹果ID] >双击你的团队名称>点击刷新按钮来更新证书和配置文件。

#7


24  

OK, sharing here another cause of this error. It took me a few hours to sort this out.

在这里分享另一个错误的原因。我花了几个小时才整理好。

In my case the trust policy of my certificate in Keychain Access was Always Trust, changing it back to defaults solved the problem.

在我的情况下,我在Keychain访问中的证书的信任策略始终是信任,将其更改为默认值解决了问题。

In order to open the certificate settings window double click the certificate in the Keychain Access list of certificates.

为了打开证书设置窗口,双击证书的Keychain访问列表中的证书。

dyld:没有加载的库:@rpath/libswiftCore.dylib。dyld:没有加载的库:@rpath/libswiftCore.dylib。

#8


17  

I was having this issue with running my Swift tests (but not my app). It turns out that the test needed to have more than @executable_path/Frameworks in it's Runpath Search Paths build setting for the test target. Setting the Runpath Search Paths to the following worked a charm for me:

我在运行我的快速测试(但不是我的应用程序)时遇到了这个问题。事实证明,在它的Runpath搜索路径中,需要有超过@executable_path/框架的测试来构建测试目标。设置Runpath搜索路径到以下工作对我有吸引力:

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

#9


16  

I think Apple has already summarized it under Swift app crashes when trying to reference Swift library libswiftCore.dylib

我认为苹果已经在Swift应用程序崩溃的情况下总结了它,当它试图引用Swift的图书馆libswiftCore.dylib时。

Cited from Technical Q&A QA1886:

摘自《技术问答》QA1886:

Swift app crashes when trying to reference Swift library libswiftCore.dylib.

Swift应用程序崩溃时,试图引用Swift库libswiftCore.dylib。

Q: What can I do about the libswiftCore.dylib loading error in my device's console that happens when I try to run my Swift language app?

关于libswiftCore我可以做些什么?当我试图运行我的Swift语言应用程序时,我的设备控制台中的dylib装载错误发生了?

A: To correct this problem, you will need to sign your app using code signing certificates with the Subject Organizational Unit (OU) set to your Team ID. All Enterprise and standard iOS developer certificates that are created after iOS 8 was released have the new Team ID field in the proper place to allow Swift language apps to run.

你纠正这个问题,将需要签署应用程序使用代码签名证书的主题组织单元(OU)设置为您的团队ID。所有企业和标准iOS开发者证书后创建的iOS 8发布新团队ID字段在适当的地方,允许迅速语言应用程序运行。

Usually this error appears in the device's console log with a message similar to one of the following:

通常,该错误出现在设备的控制台日志中,其消息类似如下:

[....] [deny-mmap] mapped file has no team identifier and is not a platform binary:
/private/var/mobile/Containers/Bundle/Application/5D8FB2F7-1083-4564-94B2-0CB7DC75C9D1/YourAppNameHere.app/Frameworks/libswiftCore.dylib

Dyld Error Message:
  Library not loaded: @rpath/libswiftCore.dylib

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000120021088
Triggered by Thread: 0

Referenced from: /private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/TestApp
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/Frameworks/libswiftCore.dylib: mmap() error 1 at address=0x1001D8000, size=0x00194000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/C3DCD586-2A40-4C7C-AA2B-64EDAE8339E2/TestApp.app/Frameworks/libswiftCore.dylib
Dyld Version: 353.5

The new certificates are needed when building an archive and packaging your app. Even if you have one of the new certificates, just resigning an existing swift app archive won’t work. If it was built with a pre-iOS 8 certificate, you will need to build another archive.

在构建存档和打包应用程序时需要新的证书,即使您有新的证书,只需重新签下现有的swift应用程序存档就不行。如果它是使用预ios8证书构建的,则需要构建另一个存档。

Important: Please use caution if you need to revoke and setup up a new Enterprise Distribution certificate. If you are an in-house Enterprise developer you will need to be careful that you do not revoke a distribution certificate that was used to sign an app any one of your Enterprise employees is still using as any apps that were signed with that enterprise distribution certificate will stop working immediately. The above only applies to Enterprise Distribution certificates. Development certs are safe to revoke for enterprise/standard iOS developers.

重要:如果需要撤销和设置新的企业分发证书,请使用警告。如果你是一个内部企业开发人员你需要小心,你不撤销一个分布证书用于签署一项应用任何一个企业的员工仍在使用任何应用程序,签署了与企业分配证书将立即停止工作。以上仅适用于企业发行证书。开发证书对于企业/标准的iOS开发人员来说是安全的。

As the AirSign guys state the problem roots from the missing OU attribute in the subject field of the In-House certificate.

正如AirSign的人指出问题的根源是在内部证书的主题字段中缺失的OU属性。

Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, OU=269J2W3P2L, O=Company Name, C=FR

主题:UID=269J2W3P2L, CN=iPhone发行版:公司名,OU=269J2W3P2L, O=公司名称,C=FR。

I have an enterprise development certificate, creating a new one solved the issue.

#10


14  

You have to set the Runpath Search Paths to @executable_path/Frameworks as showed in the following screenshot of Build Settings:

您必须将Runpath搜索路径设置为@executable_path/框架,如下面的构建设置截图所示:

dyld:没有加载的库:@rpath/libswiftCore.dylib。

If you have any embedded frameworks made in Swift, than you can set to YES the Build Options Embedded Content Contains Swift Code.

如果你有任何嵌入的框架,在Swift中,你可以设置为YES,嵌入的内容包含Swift代码。

#11


10  

Let's project P is importing custom library L, then you must add L into

让我们项目P导入自定义库L,然后您必须将L添加进去。

P -> Build Phases -> Embed Frameworks -> +. That works for me.

P ->构建阶段->嵌入框架-> +。这适合我。

dyld:没有加载的库:@rpath/libswiftCore.dylib。

#12


7  

I was having the same problem after moving to a new mac, and after hours, trying all the suggested answers in the questions, none of this worked for me.

在搬到一个新的mac电脑后,我也遇到了同样的问题,在几个小时之后,我尝试了所有问题的答案,但这些都不适合我。

The solution for me was installing this missing certificate. http://developer.apple.com/certificationauthority/AppleWWDRCA.cer

我的解决方案是安装这个丢失的证书。http://developer.apple.com/certificationauthority/AppleWWDRCA.cer

Found the answer here. https://*.com/a/14495100/976628

找到了答案。https://*.com/a/14495100/976628

#13


6  

Change Copy Pods Resources for the target from:

为目标更改复制pod资源:

"${SRCROOT}/Pods/Target Support Files/Pods-Wishlist/Pods-Wishlist-resources.sh"

to:

:

"${SRCROOT}/Pods/Target Support Files/Pods-Wishlist/Pods-Wishlist-frameworks.sh"

#14


6  

I solved by deleting the derived data and this time it worked correctly. Tried with Xcode 7.3.1GM

我通过删除派生数据解决了这个问题,这一次它工作正常。尝试与Xcode 7.3.1GM

#15


4  

In my case, it was just the name of my target :

在我的案例中,这只是我的目标的名字:

I renamed it like this : MyApp.something and the same issue appeared. But I saw in the build Settings window, my product module name has been changed like this MyApp-something. So, I removed the dot in my target name (MyAppSomething) and the issue was gone.

我把它重新命名为:MyApp。出现了同样的问题。但是我在build Settings窗口中看到,我的产品模块名称已经像这个myapp一样被改变了。因此,我删除了目标名称中的点(MyAppSomething),这个问题就消失了。

#16


4  

For me, having tried everything with no success, what worked was to remove @executable_path/Frameworks from the Packaging section (don't know how it came to be in there in the first place)

对我来说,尝试了所有没有成功的东西之后,我的工作是将@executable_path/框架从打包部分删除(不知道它是如何在第一个地方出现的)

dyld:没有加载的库:@rpath/libswiftCore.dylib。

#17


4  

After having tried out everything, I finally found out, that the build seems not always include every detail again and again. Maybe for speeding up the process... In order to ensure WHOLE packaging before running on a device, make a Clean first: Shift-Cmd-K. Then build with: Cmd-B. After that run it on your device. Easy. Kind regards to all you nice guys in that place!

在尝试了一切之后,我终于发现,构建似乎并不总是一次又一次地包含每个细节。也许是为了加速这个过程……为了确保在设备上运行之前的整个包装,首先要做一个干净的:Shift-Cmd-K。然后构建:Cmd-B。然后在你的设备上运行它。一件容易的事。向你在那个地方的好男人致以亲切的问候!

#18


4  

None of the solutions worked for me. Restarting the phone fixed it. Strange but it worked.

这些解决方案都不适合我。重启手机修好了。奇怪的但它工作。

#19


3  

none of these solutions seemed to work but when I changed the permission of the world Wide Developer cert to Use System defaults then it worked. I have included the steps and screenshots in the link below

这些解决方案似乎都没有奏效,但是当我改变了世界范围的开发者cert使用系统默认值的权限时,它就成功了。我已经包括了下面链接的步骤和截图。

I would encourage you to log the ticket in apple bug report as mentioned here as Apple really should solve this massive error: https://*.com/a/41401354/559760

我建议您在apple bug报告中记录下这张罚单,因为苹果确实应该解决这个巨大的错误:https://*.com/a/41401354/559760。

#20


2  

Xcode 7.2, iOS 9.2 on one device, 9.0 on other. Both had the error. No idea what changed that caused it, but the solutions above for the WWDR were correct for me. Install that cert and problem solved.

Xcode 7.2, ios9.2在一个设备上,9.0在另一个设备上。都有错误。不知道是什么导致了它,但是WWDR上面的解决方案对我来说是正确的。安装证书,解决问题。

https://forums.developer.apple.com/message/43547 https://forums.developer.apple.com/message/84846

https://forums.developer.apple.com/message/43547 https://forums.developer.apple.com/message/84846

#21


2  

There are lot's of answers there but might be my answer will help some one.

这里有很多的答案,但我的答案可能会帮助一些人。

I am having same issue, My app works fine on Simulator but on Device got crashed as I Lunches app and gives error as above. I have tried all answers and solutions . In My Case , My Project I am having multiple targets .I have created duplicate target B from target A. Target B works fine while target A got crashed. I am using different Image assets for each target. After searching and doing google I have found something which might help to someone.

我也有同样的问题,我的应用程序在模拟器上运行良好,但在我的午餐应用程序中,设备崩溃了,并给出了上面的错误。我已经尝试了所有的答案和解决方案。在我的案例中,我的项目有多个目标,我已经从目标A中创建了一个重复的目标B。我为每个目标使用不同的图像资产。在搜索和做谷歌之后,我发现了一些可能对某人有帮助的东西。

App stop crashing when I change name of Launch images assets for both apps . e.g Target A Launch Image asset name LaunchImage A . Target B Lunch Image asset name LaunchImage B and assigned properly in General Tab of each target . My Apps works fine.

当我更改了两个应用程序的启动图像资产名称时,应用程序停止崩溃。e。目标A启动图像资产名称LaunchImage A。目标B午餐图像资产名称LaunchImage B,并在每个目标的General选项卡中正确分配。我的应用程序工作正常。

#22


1  

I'm using Xcode 8.3.3 and Xcode 9.2. The solution for me was to switch my default Xcode from 8 to 9 using Xcode Select:

我使用的是Xcode 8.3.3和Xcode 9.2。我的解决方案是使用Xcode选择将我的默认Xcode从8改为9:

$ xcode-select --print-path

xcode-select美元——print-path

$ sudo xcode-select -switch /Applications/Xcode-9.2.app

$ sudo xcode-select -switch / application /Xcode-9.2.app。

Edit: Actually what seemed to help here was that Xcode 9.2 used the derived data from Xcode 8.3.3. Not a solution but at least it allows me to move forward with my work.

编辑:实际上,似乎有帮助的是Xcode 9.2使用来自Xcode 8.3.3的派生数据。这不是一个解决方案,但至少它让我能够继续工作。

#23


0  

To add on to the Enterprise distribution cert solution: you can open Keychain and inspect the cert. If there is any red text saying the trust chain can't be verified or it being revoked, it WILL NOT WORK! On my computer, our distribution cert was showing as revoked even though the web portal showed it as still valid. We got a new distribution cert, which was green (valid) in Keychain, and this solved the issue.

要添加到企业分发证书解决方案:您可以打开Keychain并检查cert,如果有任何红色文本表示信任链不能被验证或被撤销,那么它将无法工作!在我的电脑上,尽管门户网站显示它仍然有效,但我们的分发证书却显示为被撤销。我们得到了一个新的分配证书,它在Keychain是绿色的(有效的),这就解决了这个问题。

#24


0  

The above solutions did not work for me. I fix the issue by the following steps:

以上的解决方案对我不起作用。我通过以下步骤来解决这个问题:

  1. I had to go to the phone (Settings > Profile) and delete the profiles that were in the phone(including all the apps associated with those profile/provisions).
  2. 我必须去电话(设置>配置文件),删除手机上的配置文件(包括所有与这些配置文件相关的应用程序)。
  3. After that, make sure that you download the apple provisions in xcode. Go to xcode settings > account and sign in into your apple developer account.
  4. 在此之后,请确保您下载了xcode中的apple条款。到xcode设置>帐户,并登录到你的苹果开发者帐户。

#25


0  

I'm using Xcode 7.2. If you tried all of above and the error still occurs, try deleting the old certificate from Keychain Access! It's such a pain to finally fix this.

我使用Xcode 7.2。如果您尝试了以上所有操作,并且仍然发生错误,请尝试从Keychain访问删除旧证书!最终解决这个问题真是痛苦。

#26


0  

In my case,

在我的例子中,

I have set @executable_path/Frameworks

我有设置@executable_path /框架

But I have to also set "Framework search paths"

但我还要设置"框架搜索路径"

$(PROJECT_DIR)/Frameworks

change as recursive

变化是递归

Which works for me.

这适合我。

#27


0  

When Xcode asks you to reset certs, you reset it. And the app can be run on actual device without crash with that error messages. Once this problem is fixed in one swift project. Other swift projects with this problem are fixed also.

当Xcode要求你重置证书时,你重置它。应用程序可以在实际设备上运行,而不会出现错误消息。一旦这个问题被固定在一个快速的项目中。其他有这个问题的swift项目也都是固定的。

I have struggled for these about half a day and I found that reset certs again and again in provisioning portal doesn't help.

我挣扎了半天,我发现在供应门户网站上重新设置certs并没有什么帮助。

#28


0  

I have multiple version of Xcode installed at the same time. The framework was built with a newer version of Xcode. The app that I tried to compile was with an older version of Xcode. When I cleaned and compiled both the framework and the app with the same version of Xcode then things worked.

我同时安装了多个版本的Xcode。框架是用新版本的Xcode构建的。我尝试编译的应用程序是使用旧版本的Xcode。当我用相同版本的Xcode来清理和编译这个框架和应用程序时,事情就顺利了。

#29


0  

In my case, one of my testing targets was working but the other one was not. It was giving the above error with a missing library or whatever. I compared the settings for both of the testing targets and found that one was missing the configuration for "Test Host", so I copied that from the working test target and it fixed my broken test target!

在我的案例中,我的一个测试目标是工作,而另一个不是。它给出了一个丢失的库或其他的错误。我比较了两个测试目标的设置,发现其中一个缺少“测试主机”的配置,所以我从工作测试目标中复制了这个,它修复了我的测试目标!

dyld:没有加载的库:@rpath/libswiftCore.dylib。

#30


0  

From the post of https://github.com/CocoaPods/cocoapods-integration-specs/pull/24/files, that mean swift.dylib need sign but failed. I failed even create a new swift project with cocoapod support.

从https://github.com/cocoapods/cocoapods-integrationspecs/pull/24/files,这意味着swift。dylib需要签名,但失败了。我甚至失败了,创建了一个新的swift项目,并提供了cocoapod支持。