在将Swift类添加到旧的Xcode项目后,我得到这个错误。
dyld:库未加载:@rpath/libswift_stdlib_core.dylib
我怎样才能使项目再次运行?
在将Swift类添加到旧的Xcode项目后,我得到这个错误。
dyld:库未加载:@rpath/libswift_stdlib_core.dylib
我怎样才能使项目再次运行?
当前回答
参考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 6.1.1版本的Mavericks,在带有iOS 8.1.1的iPhone5上测试,也遇到了同样的问题。我尝试了所有可能的解决方案,包括新的证书和配置配置文件,但都没有帮助。我在项目级和目标级上对包含Swift代码的嵌入式内容和跑道搜索路径进行了更改。
我现在已经安装了优胜美地,没有任何进一步的改变,它开始工作了。
我也遇到过这个问题,只是没有定位libswiftXCTest.dylib。
解决方案是在Build Phases/Link Binary with Library中将XCTest.framework添加到Tests目标中。即使当我试图构建主目标时,我也会得到这个错误。
我也有同样的问题。我的解决方案是将每个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
我在我的项目中添加了SCLAlertView pod,后来删除了它。我没有从我的视图控制器中删除导入SCLAlertView。理想情况下,它应该给出一个编译时错误,但它给出了一个运行时错误,提到dyld: Library not loaded: @rpath/SCLAlertView.framework。我从我的视图控制器中删除了导入SCLAlertView,构建它,它没有给出错误。所以在我的情况下,我试图导入一个没有找到框架的库。删除这些引用将解决您的问题。
我真的不知道为什么这个问题被否决了,当我第一次尝试在一个现有的项目中使用Swift时,我也遇到了这个问题。Xcode重启也为我解决了这个问题。