swift – Could not find module ‘ModuleName’ for target ‘x86_64-apple-ios-simulator’


I have 3 schemes in my app. I am not sure why but when running on iOS simulator on one of these schemes(Debug), I get the following error on the import line:

Could not find module 'ModuleName' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, at: /Users/me/Library/Developer/Xcode/DerivedData/project-bgumdcxgpxtntlgtykppxpaxjcji/Index.noindex/Build/Products/Debug-iphonesimulator/ModuleName.swiftmodule

Running on any other scheme will succeed, and also running this scheme will work on real device, but the problem seems to be when running in iOS simulator. Does anyone know why? I have tried to make Build Settings be the same for all schemes, but no success. I have also tried all solution provided in another SO questions but none worked for me.

Library was installed using SPM. Before that, it was working fine using Cocoapods. I did not change anything except removing the pod and removing its framework from Other Linker Flags(because Xcode was complaining about that).

This was not the case with another library I switched from Cocoapods to SPM, everything worked fine.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img