iosswiftxcodeprovisioning-profilecode-signing-entitlements

Conflicting app identifiers after adding HealthKit to Apple Watch Extension


I was adding a watchOS target to my already existing iOS target. Everything worked fine until I added the HealthKit capabilities in the "Signing & Capability" Section of the watchapp.extension. Whereas everything worked fine with the iOS target, the watchapp extension complained after I added the respective capability and I received 3 errors. From which the first stated:

"Failed to register bundle identifier. The app identifier "[...].watchkitapp.watchkitextension" cannot be registered to your development team. Change your bundle identifier to a unique string to try again."

After adding the capability without details

After adding the capability with details

Things I tried so far and noticed are listed below:

"Provisioning profile "iOS Team Provisioning Profile: *" doesn't support the HealthKit capability."

"Provisioning profile "iOS Team Provisioning Profile: *" doesn't include the com.apple.developer.healthkit and com.apple.developer.healthkit.access entitlements."

My literal guess is that the provisioning profile for the watchapp.extension is the root cause and that it is somehow attached to another team - which I don't know why. It lags one day behind the one for the iOS target and hasn't received the updated about the healthkit. The certificate in the provisioning profile is the same though as in the one concerning the iOS target. However, even starting from zero and readding the watchapp target did not help.


Solution

  • The watch app extension was registered with my free plan account under the same identifier and caused the conflict. Apple had to delete that identifier in order for it to be assigned to my 'real' developer account.

    Somehow I managed to register my watch app extension with the same initial bundle identifier as my parent app. However, rather than registering it with my real developer account I did so with my free plan account, hence the "Failed to register bundle identifier." error.

    Surprisingly my watch app (not the extension) was registered under my real account which bugs me, since they are both created at the same time when you create the watchOS target.

    The problem with that is, that as a free user you cannot look into the identifier registered under your account. You have to ask Apple to delete the identifiers for you. After that Xcode was creating a new provisioning profile.