I had the same with TestTarget which can't resolve the main target local SPM
finally, fix with this approach
I added all main target dependencies to the test target too and after that find, I had some compiler issues in which the compiler showed me this wrong error, and when errors were fixed this error disappeared
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: