Why Do I Keep Getting The Error "No Such Module 'Realmswift'"

RealmSwift: No such module 'RealmSwift'

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.

Why do I keep getting the error no such module 'realmswift'?

Best way to resolve this issue is follow these steps

1) click on project or in product in xcode then click on manage scheme

2) after uncheck your project and check your pod u have installed

3) Build your application with your pod

4) After again change your scheme and uncheck pod and check your app this will works , i added images to explain this :)

First Image

Build like this
Build like this

No such module RealmSwift

This is more of a troubleshooting step than a direct answer since I duplicated your issue.

You've been using Realm a while so you know this but for future readers, ensure that any file where you're using RealmSwift includes

import RealmSwift

I just tried your podfile on a new project and am getting weird behavior as well. I replaced your podfile with the following 5 lines and it works correctly.

project 'Realm Test.xcodeproj'
target 'Realm Test' do
use_frameworks!
platform :osx, '10.13'
pod 'RealmSwift'
end

That was a macOS project but it worked equally well with an iOS project. On that project I uncommented #platform :ios, '12.0'

I think this is the issue

inherit! :search_paths

That lets the target know about the search paths but does not link them in. I would suggest changing that to

inherit! :complete

Which appears to be working in my project.

Oh - for completness, I ran into this once as well and the solution was

add the parent path of RealmSwift.framework (i.e., the containing
directory) to your framework search paths.

No such module error in Xcode 12.4 Apple M1

Adding this to podfile helps me

post_install do |installer|   
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end

Getting 'no such module' error when importing a Swift Package Manager dependency

It turned out that Swift Package Manager implicitly depends on the project's Configuration names. I had them at live/qa instead of Release/Debug, and changing them back resolved the issue. Very odd, but I hope it saves you some trouble dear reader.



Related Topics



Leave a reply



Submit