57

I am trying to archieve my app for submission however I am running into issues with code signing.

Basically I have a Today Widget extension for my app. I am unsure about what I should be setting the provisioning profile as. I assumed that I would just use the same profile that I have used for my app, however I get this error:

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.

I can of course click 'Fix Issue', but does this actually solve the problem? It just changes my distribution settings to 'iOS Developer' and providing profile to 'Automatic'.

Andrew
  • 15,357
  • 6
  • 66
  • 101
user3746428
  • 11,047
  • 20
  • 81
  • 137
  • If you build the App, the extension is embedded within the App. You don't need to submit the extension by itself. – dasdom Sep 14 '14 at 20:33
  • So what would I leave the code signing and provisioning profile as? 'iOS Developer' and 'Automatic'? – user3746428 Sep 14 '14 at 20:41
  • No. You need a distribution profile because you want to distribute to the App Store. Then archive the App using this distribution profile. The extension is added to the App automatically. – dasdom Sep 14 '14 at 20:44
  • Yeah, sorry. I have a distribution profile for the app, but I am asking what I leave the settings for the widget as? – user3746428 Sep 14 '14 at 20:49
  • Ignore the widget. You are compiling the App. I submitted an App with an extension like that today. And it seems to have worked. – dasdom Sep 14 '14 at 20:50
  • 1
    How did you resolve this? When I try to compile the App for distibution, it says the same error about the Today Widget. Do you need two Distribution provisioning profiles (one for the app and one with the widget bundle id)? – Markus Rautopuro Sep 22 '14 at 18:57
  • 2
    Yup. You need a separate provisioning profile for the widget and the app. Then use the same distribution certificate for both the widget and the app. – user3746428 Sep 22 '14 at 19:36

3 Answers3

153

I was struggling with the same problem, and resolved it this way:

  • You need one App ID configured to the provisioning portal (I assume you have your com.apple.yourappname there)
  • You need to then configure the second App ID for the Today Widget (which should be com.apple.yourappname.something, where something is the name for your widget, like Today)

Then you need to create two App Store Distribution provisioning profiles:

  • One for the main App
  • Second one for the widget

Then assign the correct provisioning profiles for each target to the project settings and set to build for Distribution.

Markus Rautopuro
  • 7,997
  • 6
  • 47
  • 60
  • 13
    Thanks. I think it's really important that you pointed out that the widget app id is com.apple.appname.something. I tried com.apple.widgetname and it didn't seem to work – kevinl Oct 01 '14 at 17:08
  • 1
    Thank you @markus-rautopuro! I use command line for building. How assign provisioning profiles in command line? – Dmitry Jan 13 '15 at 07:36
  • Provisioning should work automatically when you place provisioning profiles to `~/Library/MobileDevice/Provisioning Profiles` and then set the Xcode project to use automatic provisioning. If it doesn't work for some reason, try opening Xcode and selecting the provisioning profile for the targets in project settings and then save the project? – Markus Rautopuro Jan 14 '15 at 11:36
  • There does not seem to be a way to set the Provisioning Profile on the Today target, it appears for the main target. – Rob Jul 23 '16 at 16:52
  • 1
    Good thing on XCode 8 you can ask XCode to automatically manage the profiles for you and it works very well. I just submitted my first app with Today Ext on XCode 8 with great ease. If you haven't, I suggest u to update to XCode 8. – GeneCode Sep 19 '16 at 04:57
  • 1
    You saved hours of my time, Thanks, I don't understand why this process has to be so complicated unlike Android Deployments – Ali Nov 24 '18 at 16:02
3

My problem was because of i added "arm" in the Excluded architecture section. I revert it and the problem goes away. It is weird.

enter image description here

Dave Wong
  • 315
  • 2
  • 10
2

Try to create a new App Id for your App extension in Certificates, Identifiers & Profiles (https://developer.apple.com/account). Then create a Provisioing profile for the newly created App id.

If the bundle id for your App is com.apple.appname you create an app extensions with the bundle id com.apple.appname.appextensionname. The same id is then used in Xcode for the widget.

Daniel Nord
  • 535
  • 5
  • 10
  • What provisioning profile you should select for the Today widget? Do you need to add the bundle ID of the widget to provisioning portal as a new app? Do you need a second distribution provisioning profile for the widget? – Markus Rautopuro Sep 22 '14 at 19:03
  • 2
    Yes, create a new app ID the same way you are creating one for an app. Then you create a second distribution profile. – Daniel Nord Sep 23 '14 at 20:38
  • 1
    Should push notification be enabled in Widgets app id? – Jayaraj Feb 28 '18 at 12:18