Ios – Signing iOS App: App ID Cannot be Registered to Your Development Team

cordovaionic3iosprovisioning-profile

I need to replace a deployed iOS native app with a new Ionic3 / Cordova hybrid app. The new hybrid app builds successfully (on macOS Sierra 10.12.6) but I can't sign the app (so that it can be uploaded to the app store).

As a first step, I'm focused on getting the new app on the app store (as alpha to test with TestFlight). I've removed all "development" certificates/profiles from developer.apple.com.

There's a lot of information/questions/answers on the web about signing apps. I've spent a couple of days on this issue and cannot get it to work no matter what I read or what I try.

The current iOS app code (deployed)

In Info.plist, $(PRODUCT_BUNDLE_IDENTIFIER)

In /bbh.xcodeproj/project.pbxproj, PRODUCT_BUNDLE_IDENTIFIER = "NSP.BBH-Mobile";

Re-create development provision

  1. Open Keychain. Delete all developer/iPhone certificates. Delete all keys.

  2. On developer.apple.com, delete development certificate and development provisioning profiles.

  3. Confirm my iPhone device is registered with the correct UDID.

  4. In Keychain, generate a certificate signing request file.

  5. In developer.apple.com, create a development certificate, upload the certificate signing request generated in the previous step, download the certificate .cer file.

  6. Double click on the .cer file. Keychain opens. Choose to add to "log in".

  7. In Keychain > certificates, choose export, specify the strong password. Certificates.p12 file will be generated.

  8. In developer.apple.com, create a development provisioning profile. Choose "iOS App Development". Choose an App ID … but which one?

    App IDs in developer.apple.com
    BBH Mobile = com.bbh.*
    BBH Mobile = NSP.BBH-Mobile
    Xcode iOS Wildcard App ID = *

    Notice on-screen reads:
    "If you plan to use services such as Game Center, In-App Purchase, and Push Notifications, or want a Bundle ID unique to a single app, use an explicit App ID.
    If you want to create one provisioning profile for multiple apps or don't need a specific Bundle ID, select a wildcard App ID. Wildcard App IDs use an asterisk (*) as the last digit in the Bundle ID field.
    Please note that iOS App IDs and Mac App IDs cannot be used interchangeably."

    We need push notifications so choose an explicit App ID = AYW4J8P7X3.NSP.BBH-Mobile
    app id = team id (generated by apple) + bundle id (supplied by the user)
    It makes sense to choose this App ID which includes the bundle id of the iOS currently deployed.
    https://www.screencast.com/t/C0QdPdxwh09t

    Choose a development certificate (just created), choose all devices.

  9. Download the development profile and double click to install (in Xcode).

Double-clicking doesn't seem to do anything? How do I know it's installed in Xcode correctly?
Do I need the .mobileprovision file on my iPhone? The mac server is in the cloud so I don't have my iPhone connected via USB to the mac.

  1. Open Xcode. Confirm my apple account added in Xcode > Preferences > Accounts. In the project, targets, signing, click "Automatically manage to sign".

  2. Choose my personal team. The following errors are displayed:

    enter image description here

    Error 1: The app ID "NSP.BBH-Mobile" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.

    Why does it prompt to change bundle id? Isn't it standard to have one app id and to generate both a debug/development and release?

    Error 2: No profiles for 'NSP.BBH-Mobile' were found Xcode couldn't find any iOS App Development provisioning profiles matching 'NSP.BBH-Mobile'.

But we just created a new development provision and selected App ID = NSP.BBH-Mobile. Why doesn't Xcode recognize this?

Best Answer

you may try unselect Automatically manage signing and import provisioning profile manually.