2
votes

After installing Realm Swift, I see the following error when running my test program from within Xcode:

dyld: Library not loaded: @rpath/libswiftCore.dylib
 Referenced from: /Users/(*****)/Library/Developer/CoreSimulator/Devices/*****/data/Containers/Bundle/Application/*****/My.app/Frameworks/RealmSwift.framework/RealmSwift
 Reason: Incompatible library version: RealmSwift requires version 1.0.0 or later, but libswiftCore.dylib provides version 0.0.0

I have tried:

  • Cleaning the build folder
  • Restarting Xcode
  • Enabling the Embedded Content Contains Swift Code build setting.

I am using Xcode 7.2.1 with Swift 2.1.1, and am integrating Realm using its dynamic Framework.

1
Did you perform accurate all steps described at the realm installation section?Azat
Which version of Realm Swift are you using?bdash
maybe put a demo project in github to help people understand the problem and better help you.Zhao
@Azat Thanks. I'll check again.Hiroyuki Kikuchi
@bdash Thanks. version 0.98.0Hiroyuki Kikuchi

1 Answers

2
votes

Apple states that you can't mix and match binaries built with different versions of Swift: https://developer.apple.com/swift/blog/?id=2

So you have two choices:

  1. Build Realm Swift from source following the instructions found at https://realm.io/docs/swift/latest/#installation
  2. Use a prebuilt version of Realm Swift built with the same version of Swift as your project. 0.98.5 was the last version built with Swift 2.1.1: https://github.com/realm/realm-cocoa/releases/tag/v0.98.5. 0.98.6 and later are built with Swift 2.2.