如何将Realm与包括Swift的新版本的Xcode一起使用? [英] How can I use Realm with newly released versions of Xcode that include new versions of Swift?

查看:74
本文介绍了如何将Realm与包括Swift的新版本的Xcode一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我上周刚刚更新到Xcode 9,我一直在寻找解决此错误的方法:

I just updated to Xcode 9 last week, and I've been looking for a way to get around this error:

使用Swift 3.1编译的模块无法在Swift 4.0中导入

Module compiled with Swift 3.1 cannot be imported in Swift 4.0

每次发行包含新版本Swift的Xcode新版本时,我都必须等待RealmSwift项目被更新才能构建并运行我的项目.我知道这与Swift的ABI稳定性有关,但是我也看到其他人似乎知道如何解决这一问题,直到兼容版本的Realm出现.目前,我正在运行2.8.0,这是截至昨晚的最新版本.我选择的依赖性管理器是迦太基,但类似的问题通常涉及CocoaPods,这对我没有太大帮助.

Each time a new version of Xcode is released that includes a new version of Swift, I have to wait for the RealmSwift project to be updated in order to build and run my project. I am aware that this has to do with Swift's ABI stability, but I also see others who seem to know how to get around this until a compatible version of Realm comes out. Currently, I am running 2.8.0, which was the current release as of last night. My dependency manager of choice is Carthage, but similar questions usually involve CocoaPods, which does not help me very much.

谁能为像我这样不熟悉的人提供一些清晰的说明,以便我现在就可以继续进行我的项目,并在将来的版本发布时继续进行下去?谢谢.

Can anyone offer some clear instructions for unfamiliar ones like me so I can keep working on my project now and when future versions come out? Thank you.

推荐答案

在使用没有预构建二进制文件的Xcode beta版本时,您需要将--no-use-binaries传递给carthage bootstrap,以便迦太基从中构建所有依赖项来源.

When using beta versions of Xcode which there are not prebuilt binaries for you need to pass --no-use-binaries to carthage bootstrap so that Carthage builds all of the dependencies from source.

这篇关于如何将Realm与包括Swift的新版本的Xcode一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆