我按照给定的这里步骤构建在iOS项目中使用的领域,我使用的是Xcode 8 beta 3:
我收到这些警告:
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)
而这个错误
Lipo: -remove's specified would result in an empty fat file
为什么会发生这种情况?
发布于 2016-08-01 12:14:57
你能试一下这些更新的说明吗,哪些应该适用于Beta 3?
git clone https://github.com/realm/realm-cocoa.git
Realm
项目,然后单击RealmSwift
目标,然后单击“building”选项卡,并将Use Legacy Swift Language Version
设置为Yes
(如果为SWIFT2.3构建)或No
(如果为Swift 3构建)。sh build.sh TARGET
,其中TARGET
是以下内容之一:ios-swift
、osx-swift
、tvos-swift
或watchos-swift
,这取决于您构建的平台。RealmSwift.framework
和Realm.framework
拖到您的项目中,并执行步骤3和4。如果这些不起作用,请发表评论。
发布于 2016-10-17 01:32:44
为了获得Swift 3版本的Realm
和RealmSwift
,我必须明确针对master
,将submodules
设置为true
,并包括设置Swift版本的post_install
钩子:
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
发布于 2016-08-01 02:26:57
您需要使用Cocoapods和这个吊舱来安装领域:
豆荚‘领域’,git:'https://github.com/realm/realm-cocoa.git',分支:‘主人’ pod 'RealmSwift',git:'https://github.com/realm/realm-cocoa.git',分支:‘主人’
在运行应用程序时,不要选择“转换为”为“迅速”3
https://stackoverflow.com/questions/38696369
复制