在将Swift类添加到旧的Xcode项目后,我得到这个错误。
dyld:库未加载:@rpath/libswift_stdlib_core.dylib
我怎样才能使项目再次运行?
在将Swift类添加到旧的Xcode项目后,我得到这个错误。
dyld:库未加载:@rpath/libswift_stdlib_core.dylib
我怎样才能使项目再次运行?
当前回答
重启Xcode就解决了这个问题。
其他回答
我在我的项目中添加了SCLAlertView pod,后来删除了它。我没有从我的视图控制器中删除导入SCLAlertView。理想情况下,它应该给出一个编译时错误,但它给出了一个运行时错误,提到dyld: Library not loaded: @rpath/SCLAlertView.framework。我从我的视图控制器中删除了导入SCLAlertView,构建它,它没有给出错误。所以在我的情况下,我试图导入一个没有找到框架的库。删除这些引用将解决您的问题。
参考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.
如果你通过嵌入式二进制文件添加这三个框架,它们也会被添加到链接框架和库中。删除链接框架和库中的三个条目将解决问题。
像重新启动Xcode和重启Mac这样的神奇方法对我不起作用。
对我来说,之前的解决方案都没用。我们发现在构建设置中有一个标记ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES(在早期版本中:“嵌入式内容包含Swift代码”)需要设置为YES。默认是NO !
如果在Objective-C项目转换为开始使用Swift的过程中出现了错误,就会发生此错误。问题是链接器构建设置从未正确配置,所以你必须手动完成。寻找Runpath Search Paths构建设置并将其设置为:
$(inherited) @executable_path/Frameworks
编辑:我还应该补充一点,最近有大量的错误完全是由其他原因引起的——苹果对Swift本身进行了更改,可能从Xcode 6.1或6.1.1开始。唯一的解决方案似乎是退出Xcode,在Keychain Access中销毁你的证书,到会员中心删除所有证书和配置文件(除了应用商店中的配置文件-你不能删除它们),然后从头开始整个证书请求过程。