Error compiling RealmSwift with Xcode 8.2.1 and Swift 3

I installed RealmSwift using Cocoapods. It installed successfully, but when compiling it shows 96 errors as shown below

I have tried every solution I found on the internet. I have deintegrated the pods and installed again, but I keep getting the same errors. Please help!

Upvotes: 0

Views: 219

Answers (1)

TiM
TiM

Reputation: 15991

It looks like Xcode is trying to run Realm Swift against the wrong version of Swift. A couple of things that I recommend you try:

  • Make sure to run pod spec update to update your local copy of Realm to the latest version.
  • Make sure you've followed the Realm CocoaPods instructions and added this to the bottom of your 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

If that still doesn't fix it for you, please update your question with a copy of your podfile so we can review it. :)

Upvotes: 1

Related Questions