在将Swift类添加到旧的Xcode项目后,我得到这个错误。
dyld:库未加载:@rpath/libswift_stdlib_core.dylib
我怎样才能使项目再次运行?
在将Swift类添加到旧的Xcode项目后,我得到这个错误。
dyld:库未加载:@rpath/libswift_stdlib_core.dylib
我怎样才能使项目再次运行?
当前回答
在我的情况下,我只是使用“Cmd+Shift+K”,然后“Cmd+B”运行它的工作
其他回答
解决方案6:
在我们的案例中,企业分销证书已被撤销。生成一个新的证书并更新配置配置文件解决了这个问题。
(这个错误似乎有很多不同的原因。希望这能帮助到一些人。)
方案五:
在我的案例中,accws的答案中提到的所有解决方案都非常有用,但没有一个是有效的。我通过在项目目标的“General”部分的“Embedded Binaries”部分中添加我的swift库来解决我的问题。也许这是因为我在我的工作区中包含了我的swift框架?不管它现在编译什么!准备好,斯威夫特,我来了!
如果在Objective-C项目转换为开始使用Swift的过程中出现了错误,就会发生此错误。问题是链接器构建设置从未正确配置,所以你必须手动完成。寻找Runpath Search Paths构建设置并将其设置为:
$(inherited) @executable_path/Frameworks
编辑:我还应该补充一点,最近有大量的错误完全是由其他原因引起的——苹果对Swift本身进行了更改,可能从Xcode 6.1或6.1.1开始。唯一的解决方案似乎是退出Xcode,在Keychain Access中销毁你的证书,到会员中心删除所有证书和配置文件(除了应用商店中的配置文件-你不能删除它们),然后从头开始整个证书请求过程。
发生这种情况的原因有很多。刚刚度过了一个有趣的周末,发现了另一个导致这个问题的问题(代码签名的顺序),我想创建一个总结答案,将所有可能的解决方案放在一起:
Add Embedded Content Contains Swift Code to project. You need to set this flag if your app contains Swift code. Clean project. In addition to a Project > Clean you can also delete the DerivedData and Build directories. Look under the Preferences for the location of DerivedData. Build should be in your project folder. Ensure Runpath Search Paths contains @executable_path/Frameworks. Ensure that your certificate contains your Apple Team ID in the OU (Organization Unit) field Apple will add this for you, just revoke your existing distribution certificate and create a new one, download, install on KeyChain, regenerate all provisioning profiles, download those and rebuild. Xcode restart. If everything is basically good, but Xcode hasn't gotten there yet.
这很简单。如果你正在进行自己的命令行构建,你可能会创建自己的.ipa文件来上传。在这种情况下,您需要确保以下内容:
Make sure the version of the Swift files in SwiftSupport/iphoneos is the same as the version in Contents/YourApp.app/Frameworks Because Swift is not yet binary compatible between version, you must ensure these versions are the one that you built your app with. You can find these libraries under /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos. Sign the libraries and frameworks first. You need to codesign the libraries and framework files (under Frameworks in the .app folder) first and then sign the entire .app tree. The .app tree must be signed with an entitlements.plist but not the frameworks.
希望当Swift 3.0问世时,我们不再需要将Swift捆绑到我们的应用程序中,这个问题就会消失。
我在使用带有生产证书的Ad Hoc(或企业)移动设备时遇到了这个问题。切换到开发证书和移动供应解决了这个问题。