在将Swift类添加到旧的Xcode项目后,我得到这个错误。
dyld:库未加载:@rpath/libswift_stdlib_core.dylib
我怎样才能使项目再次运行?
在将Swift类添加到旧的Xcode项目后,我得到这个错误。
dyld:库未加载:@rpath/libswift_stdlib_core.dylib
我怎样才能使项目再次运行?
当前回答
通常,如果您在构建阶段中将这个库添加到“复制文件”段,这个错误就会消失。
其他回答
方案五:
在我的案例中,accws的答案中提到的所有解决方案都非常有用,但没有一个是有效的。我通过在项目目标的“General”部分的“Embedded Binaries”部分中添加我的swift库来解决我的问题。也许这是因为我在我的工作区中包含了我的swift框架?不管它现在编译什么!准备好,斯威夫特,我来了!
参考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.
我的环境:Cocos2d 2.0, Box2d, Objective C
除了做上面的其他答案,我最后去了General选项卡,并使WatchKit可选。
解决方案6:
在我们的案例中,企业分销证书已被撤销。生成一个新的证书并更新配置配置文件解决了这个问题。
(这个错误似乎有很多不同的原因。希望这能帮助到一些人。)
最近又开始得到这个错误。虽然前两个答案在过去为我解决了这个问题,但这次没有一个建议的答案有效。我注意到错误说:
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/8D8E5347-940A-4724-ACFE-33DF4C4DCB37/your.app/Frameworks/libswiftCore.dylib: mmap() errno=1 validating first page of '/private/var/mobile/Containers/Bundle/Application/8D8E5347-940A-4724-ACFE-33DF4C4DCB37/your.app/Frameworks/libswiftCore.dylib'
所以我试着从设备上删除应用程序,然后我就可以重新构建并运行了。