I'm working on a plugin, and that target works just fine.
I made another target so I can test some computation functions. It doesn't need much from XcodeKit, just some of the structures. I added XcodeKit and Cocoa, but the import XcodeKit just says "no such module".
If I switch to the plugin target, it's just fine. I've compared both schemes, but I don't see difference which would affect finding the framework.