Update: I switched to another team, changed the bundle id etc. and got it to work for that other team!
But still no luck with the original project setup. I think it's the automatically generated provisioning profiles that are incorrect. It looks like its an "iOS Team Provisioning Profile" that is used but what I really want is a "iOS Team Store Provisioning Profile".
Is there a way to delete these profiles?
They are not visible in https://developer.apple.com/account/resources/profiles/list
I've tried to regenerate the automatic profiles but unchecking/checking "Automatically manage signing" in Xcode (validating that the "Code Signing Identity" is "Apple Distribution" in-between tries, but with no luck... Still getting the development profile and build error:
{App} has conflicting provisioning settings. {App} is automatically signed for development, but a conflicting code signing identity Apple Distribution has been manually specified. Set the code signing identity value to "Apple Development" in the build settings editor, or switch to manual signing in the Signing & Capabilities editor.