在将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代码的嵌入式内容和跑道搜索路径进行了更改。
我现在已经安装了优胜美地,没有任何进一步的改变,它开始工作了。
我有一个Obj-C项目,我开始添加swift源文件。 以下为我解决了这个问题:
链接:RUNPATH SEARCH PATHS = $(inherited) @executable_path/Frameworks Swift编译器-代码生成:嵌入内容包含Swift = YES
我刚刚从Xcode 6.3模板创建了一个新项目,并将项目设置与旧的原始项目进行了比较。
最近又开始得到这个错误。虽然前两个答案在过去为我解决了这个问题,但这次没有一个建议的答案有效。我注意到错误说:
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'
所以我试着从设备上删除应用程序,然后我就可以重新构建并运行了。
重启Xcode就解决了这个问题。
添加框架为“嵌入式二进制文件”,而不仅仅是“链接框架和库”-修正了我的问题。
我还设置嵌入内容包含Swift代码标志为YES。