Search code examples
iosrealmcocoapodsxcode11.4

Lexical or Preprocessor issue: 'realm/keys.hpp' file not found


I recently switched to Xcode 11.4 and using Swift 5. I run pod install, Realm and RealmSwift installed with the latest version till date. Now when I run the project, its showing me an error:

..../Pods/Realm/include/binding_context.hpp:24:10: 'realm/keys.hpp' file not found

enter image description here

Podfile:

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

Realm framework version: 4.4.1

Cocoapod version: 1.9.1

Xcode version: 11.4

Why is the error occurring and how can we get rid of the same?


Solution

  • To resolve the issue, I had to:

    1. remove pod 'RealmSwift' from my podfile
    2. run pod install
    3. re-add pod 'RealmSwift' in my podfile
    4. run pod install again to get latest version. It resolved the issue.