首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >为Swift 3和Xcode 8构建领域

为Swift 3和Xcode 8构建领域
EN

Stack Overflow用户
提问于 2016-08-01 10:19:24
回答 3查看 4.4K关注 0票数 5

我按照给定的这里步骤构建在iOS项目中使用的领域,我使用的是Xcode 8 beta 3:

我收到这些警告:

代码语言:javascript
运行
复制
ld: warning: ignoring file .../Realm.framework/Realm, missing required architecture x86_64 in file .../Realm.framework/Realm (2 slices)
ld: warning: ignoring file .../RealmSwift.framework/RealmSwift, missing required architecture x86_64 in file .../RealmSwift.framework/RealmSwift (2 slices)

而这个错误

代码语言:javascript
运行
复制
Lipo: -remove's specified would result in an empty fat file

为什么会发生这种情况?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2016-08-01 20:14:57

你能试一下这些更新的说明吗,哪些应该适用于Beta 3?

  1. 克隆领域Cocoa存储库:git clone https://github.com/realm/realm-cocoa.git
  2. 打开Xcode项目。单击Realm项目,然后单击RealmSwift目标,然后单击“building”选项卡,并将Use Legacy Swift Language Version设置为Yes (如果为SWIFT2.3构建)或No (如果为Swift 3构建)。
  3. 在包含git存储库的目录中,运行以下命令:sh build.sh TARGET,其中TARGET是以下内容之一:ios-swiftosx-swifttvos-swiftwatchos-swift,这取决于您构建的平台。
  4. 构建完成后,转到“build”目录,然后以您构建的平台命名的目录(例如'ios')。
  5. 打开‘swav-2.3’或‘swirt-3.0’目录(取决于您构建的版本)。
  6. 按照说明中的步骤2,将RealmSwift.frameworkRealm.framework拖到您的项目中,并执行步骤3和4。

如果这些不起作用,请发表评论。

票数 3
EN

Stack Overflow用户

发布于 2016-10-17 09:32:44

为了获得Swift 3版本的RealmRealmSwift,我必须明确针对master,将submodules设置为true,并包括设置Swift版本的post_install钩子:

代码语言:javascript
运行
复制
use_frameworks!

target 'TARGET_NAME' do
    pod 'Realm', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true
    pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true

    post_install do |installer|
        installer.pods_project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '3.0'
            end
        end
    end
end
票数 2
EN

Stack Overflow用户

发布于 2016-08-01 10:26:57

您需要使用Cocoapods和这个吊舱来安装领域:

豆荚‘领域’,git:'https://github.com/realm/realm-cocoa.git',分支:‘主人’ pod 'RealmSwift',git:'https://github.com/realm/realm-cocoa.git',分支:‘主人’

在运行应用程序时,不要选择“转换为”为“迅速”3

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38696369

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档