1
votes

Summary: Swift allows me to import RealmSwift, but it doesn't allow me to create a new instance of the Realm class (or type any code using Realm keywords). I don't have any other code because this is a brand new project.

Steps to Reproduce: 1. Make a new Xcode project 2. In Terminal, cd to the project and type 'pod init' 3. Open the Podfile and add the pod 'RealmSwift' 4. Open the Xcode project's workspace and go to the AppDelegate file 5. Import 'RealmSwift' 6. Make a new variable and make it an instance of the Realm class

Expected Results: The program runs and lets me make a new instance of the Realm class.

Actual Results: The program crashes with the following errors:

Command failed due to signal: Abort trap: 6" & "error: fatal error encountered while reading from module 'RealmSwift'.

Also, at the top of the file where I wrote the code using Realm keywords, it says:

An Internal error occurred. Source editor functionality is limited. Attempting to restore...

This is a Swift Compiler Error btw

Version/Build:

Realm version: 3.7.4

Xcode version: 4.1

Swift version: 4.1

configuration: MacBook Pro running macOS High Sierra

1
Did you run 'pod update' after adding it to the podfile?skwashua
yes. everything was at the most updated version.JoshieGuy

1 Answers

0
votes

Have you considered using a Dynamic Framework instead? I did use CocoaPods in the past but using a dynamic framework simplifies the process. Download the frameworks from here: https://realm.io/docs/swift/latest#installation

And follow the instructions: realm_dynamic-framework_installation

After you've dragged the framework into your project, it looks like so: realm_dynamic-framework_in_project

Now, the hurdle is that since this is not done through pod files, you cannot automatically update the Realm version. This you will have to do manually by downloading the newest version of the framework from time to time.