I configured RealmSwift 1.0.0 Latest Using Docs into the Xcode project. After installation i created a class file and getting module error - like: No such module 'RealmSwift' in class file.
1.
2.
3.
4.
- After adding the Realm Plugin, i created a class and get the module error below.
Please help me to solve this error.
It looks like you've added the path to RealmSwift.framework
to your framework search paths. The Realm Swift installation instructions say to add the parent path of RealmSwift.framework
(i.e., the containing directory) to your framework search paths.
A very important sanity check: if you run into this and you're using Cocoapods, please make sure you open the .xcworkspace and not the .xcodeproj file!
Follow below steps, it may be useful for you.
- Go To: Product > Schemes > New Scheme...
- Select: RealmSwift and click OK
- Build the RealmSwift target (cmd + b)
I had the same problem like you.
I resolved it by add the following code into pod file.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
Follow below instructions:
- Clean from Xcode (Shift+Cmd+K)
- Delete the Derived Data directory (~/Library/Developer/Xcode/DerivedData)
- Build the project (Cmd+B)
I've struggled with this problem as well for 2 hours; I tried several things, like cleaning, uninstalling and reinstalling the Realm pod, changing the Podfile, and so on.
Nothing worked until I restarted the computer.
I use Xcode 8.3.3 and Xcode 9.2 Beta, Swift 3, High Sierra MacOS.
After "pod install" restart Xcode
You can add Run script file for your project.
"${SRCROOT}/Pods/Target Support Files/Pods-Realm Database/Pods-Realm Database-frameworks.sh"
You can check executable file. The executable file is not xcodeproj
file. The executable xcworkspace file.
let me tell you How I get that error and I solve it.
I am using Carthage in my project.
but I am new team member, so I did git-clone the project. But I opened the project before run cathage upload command. Although I ran the cathage command, I got that error.
I could fix it doing the next:
Go to the project file.
In build phaces -> run script -> Input file.
Add
$(SRCROOT)/Carthage/Build/iOS/Realm.framework
And
$(SRCROOT)/Carthage/Build/iOS/RealmSwift.framework
I do not know why it is not always automatically linked .
Best Regards!
For me there first was an error like 'could not build Objective-C module 'RealmSwift'' which I could fix by deleting the Derived Data Folder, Pods Folder, Podfile.lock and the .xcworkspace and after that there was the error saying 'No such module 'RealmSwift'' which only disappeared when I first tried to build the project. Now everything works fine for me!