In my case, the bundle ID is associated with a deleted app. The ID is still available in Certificates, Identifiers & Profile. As a workaround, I use a new bundle ID in Xcode, e.g., newid<2>.