在将Swift类添加到旧的Xcode项目后,我得到这个错误。
dyld:库未加载:@rpath/libswift_stdlib_core.dylib
我怎样才能使项目再次运行?
在将Swift类添加到旧的Xcode项目后,我得到这个错误。
dyld:库未加载:@rpath/libswift_stdlib_core.dylib
我怎样才能使项目再次运行?
当前回答
当我用Swift语言添加一个新的Today扩展目标到一个旧项目时,这就出现了。 通过将项目更新为推荐设置可以轻松修复。Xcode 6.0.1中
其他回答
发生这种情况的原因有很多。刚刚度过了一个有趣的周末,发现了另一个导致这个问题的问题(代码签名的顺序),我想创建一个总结答案,将所有可能的解决方案放在一起:
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捆绑到我们的应用程序中,这个问题就会消失。
我的项目是一个Swift项目,有一些Objective-C类。 我用旧的inHouse(企业)证书签名时也遇到了同样的问题。
以下步骤为我解决了这个问题。
创建并使用一个新的证书和移动供应。 (参考AIRSIGN博客) 将Runpath Search Paths构建设置设置为:$(inherited) @executable_path/Frameworks。 (参考马特的回答)
升级到OS X的最新版本(Yosemite)
经过几个小时的反复试验,我终于找到了这个问题的解决办法。 -当然,如果这适用于你的情况。
我也有同样的问题,直到我把我的Mac OS X从Mavericks升级到Yosemite。 -它解决了我的问题,希望它也能解决你的问题
我也有同样的问题。我的解决方案是将每个pod声明移动到目标子句中。
来自:
pod 'SomePod1'
pod 'SomePod2'
pod 'SomePod3'
target 'MyAwesomeApp', :exclusive => true do
end
To:
target 'MyAwesomeApp', :exclusive => true do
pod 'SomePod1'
pod 'SomePod2'
pod 'SomePod3'
end
我的猜测是,如果pod声明放在目标声明之外,CocoaPods(0.39.0)可能会使用错误的xcconfig。
Pods.debug.xcconfig (X
Pods-MyAwesomeApp.debug.xcconfig (O
通常,如果您在构建阶段中将这个库添加到“复制文件”段,这个错误就会消失。