Watchkit Extension - No matching provisioning profiles found

Edward Jones picture Edward Jones · Mar 2, 2015 · Viewed 22.5k times · Source

I have created an iPhone app that also includes a WatchKit extension, I can run this fine in the simulator but when trying to deploy to an iPhone I get a provisioning issue for the WatchKit Extention target:

"The provisioning profile specified in your build settings (“XXXX”) has an AppID of “XXXX” which does not match your bundle identifier “XXXX.watchkitextension”. Xcode can resolve this issue by downloading a new provisioning profile from the Member Center."

Xcode automatically created the WatchKit targets with the suffix .watchkitextension and .watchkitapp but this seems to cause the issues when using a provisioning profile and deploying to an iPhone.

If I remove the watchkit targets it runs fine, but this is obviously not a solution.

Thanks for your help

Answer

dogsgod picture dogsgod · Mar 26, 2015

You need to create two new AppIDs in the Developer Portal with the correct bundle identifier for your Watchkit app and Watchkit extension. The bundle identifier has to extend the main apps identifier, so if your app is com.myapp it should be com.myapp.watchkitextension and com.myapp.watchkitapp

You also need to create the related Provisioning Profiles for the AppIDs, one for the extension and one for the app.
Add required add ons (like Keychain) if you are using them in your Watch app.

All in all you will need six PPs, 3 for development, 3 for archiving/store. With Xcode 6.3 team provisioning for development stopped working (for me)

Next goto Xcode > Preferences > Accounts > YOUR_ACCOUNT > View Details ..., CTRL+Click one of the Profiles and open in Finder. Move all Profiles to Trash, then refresh the Profiles.

In your targets make sure you have the correct Team set for your main App target, the Watchkit extension target and the Watchkit App target, also make sure you have the right Provisioning Profiles assigned to main App target and the Watchkit extension target (Watchkit app Provisioning Profile can not be set but will be assigned automatically Edit: With Xcode 6.3 it can has to be set).

To be sure all is fine clean build folder: In Xcode hold command and do Product > Clean build folders ...

Now you are ready to archive.