在将Swift类添加到旧的Xcode项目后,我得到这个错误。

dyld:库未加载:@rpath/libswift_stdlib_core.dylib

我怎样才能使项目再次运行?


当前回答

我真的不知道为什么这个问题被否决了,当我第一次尝试在一个现有的项目中使用Swift时,我也遇到了这个问题。Xcode重启也为我解决了这个问题。

其他回答

方案五:

在我的案例中,accws的答案中提到的所有解决方案都非常有用,但没有一个是有效的。我通过在项目目标的“General”部分的“Embedded Binaries”部分中添加我的swift库来解决我的问题。也许这是因为我在我的工作区中包含了我的swift框架?不管它现在编译什么!准备好,斯威夫特,我来了!

这些解决方案似乎都不适合我;每成功运行几次之后,它就会再次失败。“嵌入式内容包含Swift代码”标志总是为我设置为“是”。

结果我将Xcode设置为6.3兼容。将其更改为3.2兼容解决了这个问题:

参考https://forums.developer.apple.com/thread/21292

这个解决方案对我很有效:

It occurred on my side when building an app in the command line via xcodebuild and xcrun PackageApplication, signing the app with an enterprise profile. On our CI build servers, the certificate was set to "Always Trust" in the keychain (select certificate -> Get Info -> Trust -> "Use System Default" can be changed to "Always Trust"). I had to set it back to "Use System Default" in order to make this work. Initially we set this to "Always Trust" to work-around the keychain dialogs that appear after software updates and certificate updates.

我的环境:Cocos2d 2.0, Box2d, Objective C

除了做上面的其他答案,我最后去了General选项卡,并使WatchKit可选。

我在使用带有生产证书的Ad Hoc(或企业)移动设备时遇到了这个问题。切换到开发证书和移动供应解决了这个问题。