61

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

Bricin
  • 3
  • 3
Edward Jones
  • 733
  • 1
  • 6
  • 6
  • We need to wait a little more. About two weeks before official release date, Apple will give us the possibility to upload apps to the App Store. – Dima Deplov Mar 09 '15 at 21:46
  • Check out my answer here: http://stackoverflow.com/a/30663352/3717931 Hope this helps. – Jouhar Jun 05 '15 at 09:51

7 Answers7

111

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.

Community
  • 1
  • 1
dogsgod
  • 6,267
  • 6
  • 25
  • 53
  • 6
    I find it strange that Xcode creates provisioning profiles for the app and watchkitextension but it doesn't for the watchkitapp which gets assigned the general "XC *" profile. It validates and uploads to iTunes Connect like that too. – Rivera Apr 23 '15 at 12:46
  • 1
    when trying to create a new app id for the extension and the app i get the following message: "An App ID with Identifier 'com.myapp.watchkitextension' is not available. Please enter a different string." I'm stuck. need to create the new app ids and relevant provisioning profiles but the ios dev center doesn't let me. – David Ben Ari Jun 02 '15 at 13:47
  • @dogsgod, any idea how to create the app ids for the extension and the app ? – David Ben Ari Jun 02 '15 at 14:25
  • Sure: open the developer portal and create them from there. Just make sure that the namespace of your main app needs to be extended (as mentioned in the first paragraph). Since I posted this, Apple provided some documentation. And one more hint - don't use comments to post questions ... – dogsgod Jun 02 '15 at 14:38
  • I think the voodoo is necessary. Otherwise Xcode sometimes fails to update, but what what weights much more: I got this from Apple support!. – dogsgod Jun 02 '15 at 17:58
  • Useful tip to manually delete provisioning profiles and refresh them! – C0D3LIC1OU5 Jul 08 '15 at 20:16
  • 1
    THIS THIS THIS! Totally solved it for me after much frustration. Really sad that the process is so opaque, and the error messages so cryptic. – davidgoli Apr 16 '16 at 00:34
  • I had to use (my app id).watchkitapp.watchkitextension for the extension app ID; the key thing of course is that it matches the actual bundle ID. – Jim Driscoll Jun 04 '16 at 11:18
  • I've been beating my head against the wall over an independent watch app Fastlane config for longer than I care to mention at this point. You, @dogsgod, are a saint. – Alex Blair Mar 01 '21 at 06:11
4

Im my case I've clean all my provisioning profile as suggested by other users, then I had to delete "code signing entitlements" from "Build Settings" in both App parent and extention target and after rebuild and archive, all work fine.

code signing entitlements from build Settings

christian mini
  • 1,662
  • 20
  • 39
2

I made 3 App IDs (for container app, watchkit extension, and watchkit app) belong with 3 provisioning profiles. (I was going to use AppGroup, so my app cannot share single App ID.) Setting 2 provisioning profiles for container app and watchkit extension, the archive of the my app could not pass the Xcode's validation process.

In my case, the critical point is to set the provisioning profile of the WATCHKIT APP. Setting it, it pass the validation process, and succeed to submit the app.

My procedure of the setting is the following:

  1. In Xcode, open "TARGET" of WatchKit App.
  2. Select the "Build Settings" tab.
  3. In the next line of the tab, choose "All" not "Basic."
  4. The you can find "Provisioning Profile" line in "Code Signing" section.
  5. Set the appropriate provisioning profile of yours.

For a while, I have believed 3rd party app developer cannot set provisioning profiles of WatchKit Apps in Xcode. Noticing that we can set it, the answer is now clear...

sakira
  • 21
  • 3
  • "Set the appropriate provisioning profile of yours." Other answers to the same problem suggest using "Automatic", which in my case didn't work. Choosing the specific profile did work. – nicc Jul 13 '15 at 14:43
2

I followed the Technical Q&A QA1814 and that solved it all for me. Basically you set everything to Automatic and iOS Developer. Very important to set the Team: None first, do the changes and then change back to your Team, then restart Xcode.

My situation was that I already had the provisioning profiles and certificates set up for a "normal" iOS app. I had successfully published apps with that. Now I needed to get it to work after I added a new WatchKit target to my existing app. I got many error like "No matching provisioning profiles" etc. After many hours of trouble I followed the routes in the QA1814 article and voila! - Xcode solved everything for me. Didn't need to change/resolve/update anything in Member Center etc.

Also important to use the Bundle ID's correctly. The WatchKit app and WatchKit Extension must use the same bundle ID prefix as the iOS App target.

If the iOS app has bundle ID: [Bundle ID], the WatchKit targets needs to be:

  • WatchKit App: [Bundle ID].watchkit
  • WatchKit Extension: [Bundle ID].watchkit.extension
Magnus
  • 735
  • 3
  • 9
  • 20
1

usually when you get that error its because your bundle id doesn't match the app id that is on the provision.

In the case of the watch extension, you need to add the application service App Group to your app id identifier that is associated with your provision, on the developer.apple.com portal if you are sharing data or files between the extension and your app

https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/DesigningaWatchKitApp.html

bolnad
  • 4,533
  • 3
  • 29
  • 41
0

In my case problem was different than others. I try everything but didn't solve my problem. Let me explain my situation before explain how I solve it. First it starts with adding Today Extension to my project. I created different bundle ID for my App Extension. For example if my application's bundle ID com.company.appname, I created for my Extension something like this "com.company.appname.TodayExtension". I'm using XCode Version 6.3.2 (6D2105), and XCode automatically (The provisioning profile specified in your build settings (“AppName”) has an AppID of “BundleID” which does not match your bundle identifier “BundleID2”. Xcode can resolve this issue by downloading a new provisioning profile from the Member Center...Of course I click the 'Fix Issue' button) create an provision profile for Today Extension.

And just after that I added "app group" to my application and go on coding for a while. But when I try to send my application to the AppStore (Product/Archive/Submit to AppStore), I get this error that says "None of the valid provisioning profiles allowed the specified entitlements: beta-reports-active, com.apple.security.application-groups".

You must know that "app group" could be the key point for you too...

Please go to member center/Certificates, Identifiers & Profiles/Provisioning Profiles/Distribution section. Find your application's Distribution profile and select it. As you can see that status for your profile is "Invalid (like in my case). Then here's the solution, click Edit button, after that Generate button. Now please repeat this action for all "Invalid" profiles. After all your profiles are re validated, now you can go back to your XCode project and update local provisions in your Mac. Go to : 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".

Now Product/Clean and (hopefully for the last time) Product/Archive and Submit to AppStore.

Generally speaking, it's happen because you add app group to your application, but you didn't validate all of your profiles after that.

Maybe this will helps someone.

MGY
  • 7,245
  • 5
  • 41
  • 74
0

When you are in the Xcode update Your certificate and compile Your program again, real machine commissioning will be "Your build Settings specify a provisioning profile have the UUID 'XXX', clear, no to provisioning profile was found. The Xcode can resolve this issue by downloading a new provisioning profile from the Member Center.".


  1. Close the project, find project file XXXX. Xcodeproj, right-click on the file, select "Show Package Contents" (Show Package Contents).Will open a new Finder.
  2. Find the project in the newly opened Finder. Pbxproj, and open, find the UUID you all contain an error 'XXX' line, delete.
  3. Save, restart the project, then build, with respect to OK.
Tim
  • 1,528
  • 1
  • 11
  • 8