Adding RealmSwift as a subproject: Missing required modules: 'Realm.Private', 'Realm'

南楼画角 提交于 2019-12-05 20:44:46
jpsim

You'll need to add /path/to/RealmSwift.framework/Frameworks to the “Framework Search Paths” section in Build Settings

where /path/to/RealmSwift.framework is the location of the framework.

This is because RealmSwift.framework depends on Realm.framework (where the Realm and Realm.Private modules are defined), which is vendored in its Frameworks directory.

As of Realm v0.93.0, RealmSwift.framework no longer embeds Realm.framework. This causes the same missing module error message when you upgrade. You can resolve it by linking directly to both RealmSwift.framework and Realm.framework. You'll also need to remove any pre-existing strip-frameworks.sh Run Script Phase in your app's target's Build Phases. This step is no longer needed.

Something similar happened to me when I did the pod install...

Make sure you open the appname.xcworkspace file not the appname.xcodeproj after doing the pod-install with CocoaPods.

The error No such module 'RealmSwift' will occur from any file where 'import RealmSwift' is set up if not opened from appname.xcworkspace.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!