Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot load underlying module for 'RealmSwift'

I'm trying to install Realm for Swift via Cocoapods.

First what I did was pod init into my project

Then I open podfile and changed it like this:

target 'Taskio' do
use_frameworks!
pod 'RealmSwift'

end

Then I closed podfile and execute command pod install

Everything pass good. But now when i opened workspace I'm getting error while importing RealmSwift

Cannot load underlying module for 'RealmSwift'

Error

like image 520
patrikbelis Avatar asked Mar 25 '16 08:03

patrikbelis


2 Answers

Once you have installed RealmSwift pod.

Step.1 you should open your project by double click on your_project_name.xcworkspace file.

Step.2 Go to project settings --> Build Phases --> Link Binary with Libraries --> Add framework "RealmSwift.framework" as shown below

enter image description here

That it!!

Now you can import the module

enter image description here

like image 171
swiftBoy Avatar answered Sep 22 '22 16:09

swiftBoy


Firstly try to check what workspace you open after cocoapods were install open App.xcworkspace file.If yes open Pods directory and check if file is actually installed by manually navigation to REALM folder. After navigation to this article it is possible to conclude that you should:

New project -> build&run -> add realm via cocoapods -> open Xcode workspace -> build&run again = success

like image 35
Oleg Gordiichuk Avatar answered Sep 24 '22 16:09

Oleg Gordiichuk