dyld:没有加载的库:@rpath/libswift_stdlib_core。在iPhone上运行时dylib。

时间:2022-05-10 22:37:51

Update 2: This is an old question involving the developer beta of iOS 8 and Xcode. The problem was that the Swift standard library wasn't included in the iPhone 4s iOS 8 beta. The issue has been resolved in the release.

更新2:这是一个老问题,涉及到ios8和Xcode的开发人员测试版。问题是,Swift标准库没有包含在iPhone 4s iOS 8测试版中。这个问题已经在发布中得到解决。

Update: I've been getting fed up with the errors and crashes that come along with beta software, so I decided to reset my phone to iOS 7.1.1 and now the error is gone... I have no idea what is going on, but I'm going to assume its a bug since iOS 8 is still in beta. I will file a bug report with Apple and hope it gets resolved with the next seed.

更新:我已经厌倦了与beta软件一起出现的错误和崩溃,所以我决定将我的手机重新设置为iOS 7.1.1,现在这个错误已经消失了……我不知道发生了什么,但我将假设它是一个bug,因为ios8还在测试中。我将向苹果提交一个bug报告,希望它能与下一个种子一起解决。


As many other people before me, I am receiving the following error message when running a swift-based app on my iPhone (4S running iOS 8.0 beta 1):

和我之前的许多人一样,在我的iPhone上运行一个基于swift的应用程序时,我收到了以下错误信息(4S运行iOS 8.0 beta 1):

dyld: Library not loaded: @rpath/libswift_stdlib_core.dylib
Referenced from: /private/var/mobile/Containers/Bundle/Application/
CDC7263B-9F18-4369-87CC-F36DB5163B99/TESTPROJECT.app/TESTPROJECT
Reason: no suitable image found.  Did find:
/private/var/mobile/Containers/Bundle/Application/
CDC7263B-9F18-4369-87CC-F36DB5163B99/TESTPROJECT.app/Frameworks/
libswift_stdlib_core.dylib: mmap() error 1 at address=0x00206000, 
size=0x00128000 segment=__TEXT in Segment::map() mapping 
/private/var/mobile/Containers/Bundle/Application/
CDC7263B-9F18-4369-87CC-F36DB5163B99/TESTPROJECT.app/Frameworks/
libswift_stdlib_core.dylib

When running on the iOS simulator (iPhone 4S), I get the following (many times):

在iOS模拟器(iPhone 4S)上运行时,我得到如下(很多次):

SetAppThreadPriority: setpriority failed with error 45

- This is a new single view application project generated from the built-in templates with Xcode 6 beta, with none of my own code. (Also happens with an empty application) - I have already tried the solution found here (restarting Xcode)

这是一个新的单视图应用程序项目,由内置的Xcode 6测试版生成,没有我自己的代码。(也有一个空的应用程序)——我已经尝试了这里找到的解决方案(重新启动Xcode)

I can't seem to find any other way of moving/accessing the required swift library.

我似乎找不到任何其他方式来移动/访问所需的swift代码库。

7 个解决方案

#1


2  

I'm guessing your iPhone 4S is lower than iOS 6. We also did regression tests on iPhone 4S's on iOS 6 and 7 but they were all fine. Devices on iOS 5 and 5.1 had the same error as you have though.

我猜你的iPhone 4S比iOS 6低。我们也在iOS 6和7的iPhone 4S上做了回归测试,但它们都很好。ios5和5.1上的设备出现了相同的错误。

#2


5  

For me, quitting and relaunching Xcode made this go away.

对我来说,放弃和重新启动Xcode让这一切都消失了。

#3


5  

I ran into the same problem and I think it maybe because the app has to be configured to dynamically load certain frameworks. In any case changing the "Runpath Search Paths" build setting to "@executable_path/Frameworks" seemed to fix the problem.

我遇到了同样的问题,我想这可能是因为应用程序必须被配置为动态加载某些框架。无论如何,将“Runpath搜索路径”构建为“@executable_path/框架”似乎解决了这个问题。

I'm guessing that Xcode sets this automatically for new projects but older projects may need to be fixed manually. In my older project it was blank.

我猜Xcode会自动为新项目设置这个,但是旧的项目可能需要手动修复。在我的旧项目中,它是空白的。

#4


3  

I hit this problem in simulator. I tried some settings listed here http://ikevin.tw/?p=174.

我在模拟器上碰到了这个问题。我尝试了一些在这里列出的设置:http://ikevin.tw/?

In summary, Defines Module -> Yes, Embedded Content Contains Swift Code -> Yes, Product Module Name -> [My product name].

综上所述,定义模块->是的,嵌入的内容包含Swift代码->是的,产品模块名称->[我的产品名称]。

These changes managed to get me to launch and run.

这些变化使我得以启动和运行。

The trick is that afterwards, I reverted the changes to see which of them actually made a difference. After reverting all of them, the app still launched. So it's completely unclear what actually caused the app to end up launching.

关键是,在之后,我重新修改了这些变化,看看它们到底有什么不同。在恢复所有这些功能后,该应用程序仍然启动。所以,到底是什么导致了这款应用程序的启动是完全不清楚的。

#5


2  

I had this issue using an Ad Hoc (or enterprise) mobileprovision with a production certificate. Switching to a development certificate and mobileprovision solved the issue.

我使用一个具有生产证书的临时(或企业)移动设备来解决这个问题。切换到开发证书和移动设备解决了这个问题。

#6


-1  

99% of the time when you get an error like this when upgrading the beta, it's the cache in ~/Library/Caches/com.apple.dt.Xcode* directories. Delete these and rebuild.

99%的时候,当你升级beta版时,会出现这样的错误,它是在~/库/缓存/com.apple.dt中缓存。Xcode *目录。删除和重建。

#7


-1  

I had the same issue on an exploratory project. When I tried to build on a device I got the error. All I had to do was set the 'Provisioning Profile' in 'Code Signing' and everything worked. dyld:没有加载的库:@rpath/libswift_stdlib_core。在iPhone上运行时dylib。

我在一个探索性项目上遇到了同样的问题。当我试图在一个设备上构建时,我得到了错误。我所要做的就是在“代码签名”中设置“配置文件”,一切正常。

#1


2  

I'm guessing your iPhone 4S is lower than iOS 6. We also did regression tests on iPhone 4S's on iOS 6 and 7 but they were all fine. Devices on iOS 5 and 5.1 had the same error as you have though.

我猜你的iPhone 4S比iOS 6低。我们也在iOS 6和7的iPhone 4S上做了回归测试,但它们都很好。ios5和5.1上的设备出现了相同的错误。

#2


5  

For me, quitting and relaunching Xcode made this go away.

对我来说,放弃和重新启动Xcode让这一切都消失了。

#3


5  

I ran into the same problem and I think it maybe because the app has to be configured to dynamically load certain frameworks. In any case changing the "Runpath Search Paths" build setting to "@executable_path/Frameworks" seemed to fix the problem.

我遇到了同样的问题,我想这可能是因为应用程序必须被配置为动态加载某些框架。无论如何,将“Runpath搜索路径”构建为“@executable_path/框架”似乎解决了这个问题。

I'm guessing that Xcode sets this automatically for new projects but older projects may need to be fixed manually. In my older project it was blank.

我猜Xcode会自动为新项目设置这个,但是旧的项目可能需要手动修复。在我的旧项目中,它是空白的。

#4


3  

I hit this problem in simulator. I tried some settings listed here http://ikevin.tw/?p=174.

我在模拟器上碰到了这个问题。我尝试了一些在这里列出的设置:http://ikevin.tw/?

In summary, Defines Module -> Yes, Embedded Content Contains Swift Code -> Yes, Product Module Name -> [My product name].

综上所述,定义模块->是的,嵌入的内容包含Swift代码->是的,产品模块名称->[我的产品名称]。

These changes managed to get me to launch and run.

这些变化使我得以启动和运行。

The trick is that afterwards, I reverted the changes to see which of them actually made a difference. After reverting all of them, the app still launched. So it's completely unclear what actually caused the app to end up launching.

关键是,在之后,我重新修改了这些变化,看看它们到底有什么不同。在恢复所有这些功能后,该应用程序仍然启动。所以,到底是什么导致了这款应用程序的启动是完全不清楚的。

#5


2  

I had this issue using an Ad Hoc (or enterprise) mobileprovision with a production certificate. Switching to a development certificate and mobileprovision solved the issue.

我使用一个具有生产证书的临时(或企业)移动设备来解决这个问题。切换到开发证书和移动设备解决了这个问题。

#6


-1  

99% of the time when you get an error like this when upgrading the beta, it's the cache in ~/Library/Caches/com.apple.dt.Xcode* directories. Delete these and rebuild.

99%的时候,当你升级beta版时,会出现这样的错误,它是在~/库/缓存/com.apple.dt中缓存。Xcode *目录。删除和重建。

#7


-1  

I had the same issue on an exploratory project. When I tried to build on a device I got the error. All I had to do was set the 'Provisioning Profile' in 'Code Signing' and everything worked. dyld:没有加载的库:@rpath/libswift_stdlib_core。在iPhone上运行时dylib。

我在一个探索性项目上遇到了同样的问题。当我试图在一个设备上构建时,我得到了错误。我所要做的就是在“代码签名”中设置“配置文件”,一切正常。