Xcode 11 Archiving to Generic iOS Device errors relating to registering bundle identifier and iOS App Dev provisional profiles matching my app id - ios

As the title says, I'm on Xcode 11 and trying to archive to a generic iOS device to add a new version of the app to TestFlight. It builds fine on all simulators. I don't believe I can change the bundle identifier as I'm adding an update to an app that's already on TestFlight. See below for archive errors.
Errors:
"Failed to register bundle identifier. The app identifier "com.'myappnameishere'" cannot be registered to your development team because it is not available. Change your bundle identifier to a unique string and try again."
No profiles for 'com.myappnameishere' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.myappnameishere'
What I've done:
A. Gotten an Apple Developer Account and registered my devices
B. Cleared the local Provisional Profiles using this method:
Xcode Error: "The app ID cannot be registered to your development team."
Apologies if this has already been posted but I couldn't find anything. Any help would be appreciated!

If the app is already on TestFlight, you cannot just use any apple developer id, you need to be logged in with the same apple dev account which was used to upload the app to TestFlight before
To archive, and upload an update to the app, you will also need the following installed in your machine
app store provisioning profile for the bundle id
certificate assigned to the app store profile
private key for the certificate's
(or you need to create these artefacts, and install / download them on your machine)
It is not clear if you already meet these criteria.
EDIT: answers to questions in your comment -
You may also face issues running the app on the device if you do not have developer profile for the bundle id, but with free provisioning / wildcard profile, you can circumvent this, and not need access to the specific dev account.
You can create and export archive (generate ipa file) ready for testflight using those artefacts, but to upload the ipa to testflight using any method, you will need credentials for the specific dev account. Alternatively, you can generate the ipa and share it with someone who has access and can upload the ipa.

Related

How do I update someone else's iOS TestFlight build in App Store Connect?

I'm trying to upload a new build to TestFlight. I was invited to App Store Connect as an admin, and I added my Apple ID in Xcode. There is already an existing TestFlight build a bygone developer has put up there, but I've taken over the project and need to update it. I can build the app in the simulator just fine, but when I try to make a build for a generic iOS device I get these two errors:
Failed to register bundle identifier. The app identifier "com.blahblahlbah.blahblahblah" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.
No profiles for 'com.blahblahlbah.blahblahblah were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.blahblahlbah.blahblahblah'.
I don't see any way to select a different team. Do I need to enroll in the developer program? I'm using Macincloud to try to build the app from Ionic, so I don't have an iOS device to set up two-factor authentication with, but I can get one if that is required to get this to work. Are there some build settings that I have to set up?
I eventually got the last developer to revoke their certificate. Turns out there was some issue with my account not being able to register for the developer program. After dealing with their support for a while I just made a new account. Then I was finally able to create a new certificate and select it in XCode. After that, it built just fine.

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

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
Open Keychain. Delete all developer/iPhone certificates. Delete all keys.
On developer.apple.com, delete development certificate and development provisioning profiles.
Confirm my iPhone device is registered with the correct UDID.
In Keychain, generate a certificate signing request file.
In developer.apple.com, create a development certificate, upload the certificate signing request generated in the previous step, download the certificate .cer file.
Double click on the .cer file. Keychain opens. Choose to add to "log in".
In Keychain > certificates, choose export, specify the strong password. Certificates.p12 file will be generated.
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.
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.
Open Xcode. Confirm my apple account added in Xcode > Preferences > Accounts. In the project, targets, signing, click "Automatically manage to sign".
Choose my personal team. The following errors are displayed:
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?
you may try unselect Automatically manage signing and import provisioning profile manually.
These are the steps I took to finally resolve this issue. It may not be optimal but it at least worked.
1. In Xcode, turn off automatically manage signing.
2. For signing (debug), select my development provision profile.
3. For signing (release), create a production provision profile, then select the new production profile.
Notes/Observations:
Even though I only wanted to create a signed debug for testing it seems I still had to provide valid signed release provision too.
Even after deleting all keys/certificates etc. and starting from scratch it seems Xcode has created a certificate too. Annoying - it's difficult to tell who created what now.
There was no need to change the bundle ID from the original iOS native app being replaced.
Creating a new production provision did not affect the existing production provision (which I could not use because I don't have the key).

Beta iOS app distribution problems

I have an app ready and I want to test the beta in some external devices. I am using the correct bundle id and in the iTunes connect page I created a certificate , added the devices and then created an ad-hoc provision profile. I opened it on Xcode and then archive the app and export it. I used Diawi and Ubertesters for the app distribution but in both cases I get "Unable to download app". I am missing something ?
Most probably the issue is connected to the device provisioning. Please make sure you've added your device UDID to the provisioning profile and sign your .ipa file with it. Once the newly signed up build is uploaded to Ubertesters, please try to install it on your device.

Deploying iOS app for development on multiple devices

I'm working on developing an application for iPhone. I recently acquired a new development device, and would like to deploy the application to this device for testing, in addition to the device I have already been using.
When I try to deploy the application, I get an error saying that:
No matching provisioning profiles found: None of the valid provisioning profiles include the device "name of my device"
I have read the documentation on Apple's official developer portal, but it's unclear to me what I can re-use on this new device and what has to be created for it uniquely.
Can I use the same AppId? (I would hope so, since I can only have one app Id for a given Bundle ID)
I generated a new certificate request and named it something different. I also tried to add the new development device as a device allowed to use the provisioning profile I am already using in the application. Apparently, my code signing identity is still not found when trying to build on the new device. Any suggestions?
You have to add your new device identifier to the Provisioning Profile in the Development Portal. The process should be automated if you connect the device while Xcode is open, check out the Organizer for registration progress.
Delete old profile from xcode and download fresh copy of provisioning profile with new device identifier. Add this profile to xcode.
Go to Project -> Build settings-> Code Signing -> there select latest downloaded profile.
It will work

Can't export IOS app archive from xcode for testflight

I have an IOS app archive that I want to validate and export so that I can upload it to itunes connect for testing with internal users first, then eventually beta testers. When I attempt to validate or export the archive I get a dialog titled "Failed to locate or generate matching signing assets:" with a message "Xcode attempted to locate or generate matching signing assests and failed to do so because of the following: An App ID with Indentifier 'myAppBundleId' is not available. Please enter a different string."
In the Apple Developer Member Center I had long ago created an app id for my app, corresponding APN ssl certificates, and a corresponding provisioning profile. Since I was unable to proceed as per the above dialog I tried giving my app a new bundle id, but when I then went to create an Archive with the new bundle ID it failed with a message "No matching provisioning profiles found". I next tried creating a new App ID that had an ID that matched my new bundle ID. When creating this new App ID I needed to enable push notifications, but it didn't show as enabled until I generated new SSL Certs.
I'm totally confused by all of this so this question really is about somehow finding clarity. I have a ton of unanswered questions that come to mind as I try to navigate this confusing Apple ecosystem. Some relate to the original issue and some are new questions that came up while trying things. I'll list:
When I created a new App ID for the same App, and created SSL certificates, I just reused the the CSR that I had previously created for the other earlier app ID. My thinking was that this might enable me to not actually have to do anything to my app or server since the CSR is the old one. But I'm wondering if it would fail because the bundle IDs and app IDs are new? I can't recall if there was anything in the CSR that matched to the bundle ID or App ID.
Is the app ID the same as the bundle ID?
In Developer Member Center under iOS Provisioning Profiles, there is a column titled "status". My older provisioning profiles say "Active (managed by Xcode)" and my newest ad-hoc provisioning profile says just "Active". What is the difference between the two? What makes a provisional profile managed by Xcode?
In itunes connect my bundle id is prefixed with the xcode bundle id suffix. E.g. my bundle ID in Xcode is FirstName-LastName.AppName, but in itunes connect it puts AppName - FirstName-LastName.AppName. what the heck?
Does Xcode ever automatically create an App ID?
I read that itunes connect's testflight doesn't require provisioning profiles for internal users, yet Xcode is complaining that "No Matching provisional profiles found" when I attempt to make the Archive with my new Bundle ID. Is a provisioning profile required for internal users or not?
Is there a good and up to date and comprehensive resource covering
the essentials of things like app ids, bundle Ids, testflight,
provisioning profiles, how provisioning profiles relate to app IDs,
etc. I'm left confused by Apples docs, and I've found one tutorial
on youtube that was somewhat helpful and current but not
comprehensive enough and didn't get me beyond the issues I'm
encountering. It was titled "Basically: iOS TestFlight Beta
Testing" in case anyone reading this is interested.
I'm confused by the message in Xcode "None of the valid provisioning profiles allowed the specified capabilities: Features: push, interAppAudio, and passbook". My confusion is because in Developer Member Center these features are setup when creating an App ID not when creating a provisional profile.
Any help or advice is appreciated.
I had the same issue a few days ago, fixed it by removing all invalid provisioning profiles from my account on https://developer.apple.com/, then I created a new valid provisioning profile and added the newly created one in XCode. Then in build settings I selected the valid provisioning profile instead of auto, and I was able to export with no issues. Good luck :)

Resources