[SOLVED] "Missing required module 'XYZ'" on Unit Tests when using Swift Package Manager


I’m using Swift Package Manager on an iOS app on Xcode 11 following the instructions from https://developer.apple.com/videos/play/wwdc2019/408/

Everything looks great, except Unit Tests won’t work now.

Navigator panel
Project setup


After researching a bit, I got this fixed by adding -Xcc -fmodule-map-file=$(PROJECT_TEMP_ROOT)/GeneratedModuleMaps/macosx/<missing module name>.modulemap to OTHER_SWIFT_FLAGS in the test target.


PS: Use -Xcc -fmodule-map-file=$(PROJECT_TEMP_ROOT)/GeneratedModuleMaps/iphonesimulator/<module name>.modulemap if your platform is iOS.

UPDATE: Also, it seems that this is fixed on Xcode 11.2 beta2

Answered By – betzerra

Answer Checked By – Clifford M. (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *