I’ve been having this issue recently while attempting to build my iOS app in VS for Mac.
When both signing identity and provisioning profile are set to automatic and manual I get the following error:
Apple distribution Not in keychain
Even the Build machine is connected to Mac machine over network and both developer and distribution certificates are active in keychain