Realm-cocoa: SPM + Test : Missing required modules: 'Realm.Private', 'Realm'

Created on 13 Oct 2019  Â·  5Comments  Â·  Source: realm/realm-cocoa

Goals

Use realm in my project linked via SPM , and be able to use in test cases also

Expected Results

Test cases should run

Actual Results

Received compile error: Missing required modules: 'Realm.Private'

Steps to Reproduce

  • include Realm/RealmSwift in a project via SPM
  • create test case that requires importing Realm

Version of Realm and Tooling

Realm framework version: 3.19.0

Realm Object Server version: N/A

Xcode version: 11.1

iOS/OSX version: 13

Dependency manager + version: SPM 5.1

O-Community

Most helpful comment

The workaround in this Apple thread solved the issue for me.

Under OTHER_SWIFT_FLAGS, I added -Xcc -fmodule-map-file=$(PROJECT_TEMP_ROOT)/GeneratedModuleMaps/iphonesimulator/RealmSwift.modulemap, for iOS 13.2 SDK.

This was with Xcode 11.1, and 11.3.1. And Realm 4.3.0.

All 5 comments

@grangej are you trying to include sync? If so, this will not work. If not, please upgrade to the latest XCode/Realm version.

I got same issue with v4.3.0

I am seeing this too, any news?

The workaround in this Apple thread solved the issue for me.

Under OTHER_SWIFT_FLAGS, I added -Xcc -fmodule-map-file=$(PROJECT_TEMP_ROOT)/GeneratedModuleMaps/iphonesimulator/RealmSwift.modulemap, for iOS 13.2 SDK.

This was with Xcode 11.1, and 11.3.1. And Realm 4.3.0.

➤ Jason Flax commented:

Closing due to lack of activity and workaround provided.

Was this page helpful?
0 / 5 - 0 ratings