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

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

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


当前回答

通常,如果您在构建阶段中将这个库添加到“复制文件”段,这个错误就会消失。

其他回答

对我来说,之前的解决方案都没用。我们发现在构建设置中有一个标记ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES(在早期版本中:“嵌入式内容包含Swift代码”)需要设置为YES。默认是NO !

我的项目是一个Swift项目,有一些Objective-C类。 我用旧的inHouse(企业)证书签名时也遇到了同样的问题。

以下步骤为我解决了这个问题。

创建并使用一个新的证书和移动供应。 (参考AIRSIGN博客) 将Runpath Search Paths构建设置设置为:$(inherited) @executable_path/Frameworks。 (参考马特的回答)

参考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.

我有一个Obj-C项目,我开始添加swift源文件。 以下为我解决了这个问题:

链接:RUNPATH SEARCH PATHS = $(inherited) @executable_path/Frameworks Swift编译器-代码生成:嵌入内容包含Swift = YES

我刚刚从Xcode 6.3模板创建了一个新项目,并将项目设置与旧的原始项目进行了比较。

同样的问题,对我来说,是Crashlytics/Fabric/Beta/Twitter/不管他们自称上传了一个缺少嵌入式框架的二进制文件。如果我做了一个存档,然后以标准的方式导出一个企业版,它们就很有魅力。