使用Xcode 8.2.1和Swift 3编译RealmSwift时出错

时间:2017-01-30 13:28:49

标签: ios swift3 realm xcode8.2

我使用Cocoapods安装了RealmSwift。它安装成功,但在编译时显示96个错误as shown below

我尝试过在互联网上找到的所有解决方案。我已经解散了pod并再次安装,但我仍然遇到同样的错误。请帮忙!

1 个答案:

答案 0 :(得分:0)

看起来Xcode正试图针对错误版本的Swift运行Realm Swift。我建议你尝试一些事情:

  • 确保运行pod spec update以将您的Realm本地副本更新为最新版本。
  • 确保您已按照Realm CocoaPods说明将其添加到podfile的底部:
 post_install do |installer|
   installer.pods_project.targets.each do |target|
     target.build_configurations.each do |config|
       config.build_settings['SWIFT_VERSION'] = '3.0.2'
     end
   end
 end

如果仍然无法解决此问题,请使用您的podfile副本更新您的问题,以便我们对其进行审核。 :)