在将Swift类添加到旧的Xcode项目后,我得到这个错误。

dyld:库未加载:@rpath/libswift_stdlib_core.dylib

我怎样才能使项目再次运行?


当前回答

升级到OS X的最新版本(Yosemite)

经过几个小时的反复试验,我终于找到了这个问题的解决办法。 -当然,如果这适用于你的情况。

我也有同样的问题,直到我把我的Mac OS X从Mavericks升级到Yosemite。 -它解决了我的问题,希望它也能解决你的问题

其他回答

我也遇到过同样的问题,设置正确的代码签名标识解决了这个问题(构建设置->代码签名标识)。

根据苹果的技术问题,“iOS 8发布后创建的所有企业和标准iOS开发者证书在适当的位置都有新的团队ID字段,以允许Swift语言应用程序运行”

我试了上面给出的所有答案,都没用。

终于工作后更新到优胜美地

我的环境:Cocos2d 2.0, Box2d, Objective C

除了做上面的其他答案,我最后去了General选项卡,并使WatchKit可选。

参考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.

在我的例子中,我试图导入一个自定义框架,并得到类似的错误。 结果我不得不在嵌入式二进制文件中导入框架,而不是在链接框架和库中。

嵌入式二进制文件在项目设置-> ->通用下