I'm migrating an Objective-C framework to build with Swift Package Manager, but when I build it using xcodebuild -scheme MyFramework -workspace ., SwiftPM complains:
/Users/uli/Programming/apple/MyFramework/MyFrameworkTests/MyFrameworkTests.m:4:9: module 'MyFramework' not found
@import MyFramework;
~~~~~~~^~~~~~~~~~~~~~~
I have verified that the .testTarget has a dependencies: ["MyFramework"] entry.
Found the solution due to a colleague's tip. The error message is just misleading. I thought it was unable to find the build product, when it really found the build product, but thought it was empty because I forgot to set up public headers for the Swift Package:
and to move all public headers into an
includesubfolder of the target's folder.