Can't export IOS app archive from xcode for testflight - ios

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 :)

Related

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

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.

Xcode does not automatically create app id on developer portal

As indicated in the title, Xcode is not being able to automatically create app Id and provisioning profile for an app i’m developing. I have checked the “Automatically manage signing” option but on the developer portal i can’t see any app id or provisioning profile matching the provided bundle identifier.
The problem arises only if I select, in the “team” selection, my developer account . For example, by using my enterprise account, the “waiting to repair” message is shown in Xcode and i can see the new app id created in the enterprise account portal.
If I change the bundle identifier and I select again my developer account, nothing happens, no errors and no warnings. I’m able to install the application on a device and all seems to be good. However, in my developer portal I still do not see the app id and provisioning profile so i can’t send the application to iTunes connect in order to submit to the Apple store.
Moreover, trying with other apps, all is ok even using my developer account.
I searched on line but i can’t be able to find a similar problem, are there any particular settings that are preventing the automatic Xcode app id creation to work for my app?
EDIT
it seems it’s not a problem related to the particular app. In fact I tried to create a new application fromo scratch and i have the same problem. I still do not have the problem on old apps (already uploaded on itunes connect) but i have the problem on all the newly created apps. Is that a problem with my developer certificate?
EDIT 2
I noticed that for all the newly created applications the App ID is set to: " * " (see image below). In my old apps the App ID and iOS Team Provisioning Profile are not equals to " * ". I have also deleted the wildcard id from my developer portal but the problem still remain.
I had a similar problem and i solved with a workaround. I have enabled push notifications in the "capabilities" tab (i.e, adding them to the entitlements), in this way the app id and provisioning profile have been correctly generated on the developer portal. Later, I have disabled push notifications (not needed in my project).
It's only a workaround, hope it helps
Somewhat related: I played around with Apples provisioning profiles in a desperate attempt of trying to wrap my head around their signing nightmare. In the process I deleted all the app ids from apple.developer that Xcode had automatically generated.
Afterwards I couldn't get Xcode to regenerate the app ids and I didn't wanted to manually create them, so what I had to do was to delete the automatically generated provisioning profiles from ~/Library/MobileDevice/Provisioning Profiles/.

Issues with saving an archive for Enterprise development

Whenever I archive my project and attempt to save it for Enterprise Development, I get the following error:
Wildcard App IDs can not be used to create In House provisioning profiles. Please use an Explicit App ID.
I have created an App Id in the developer portal with the bundle id of com.gasdcs.iCOOP and matched an In House Distribution profile with that App ID. In my XCode project and target I have changed the code signing identities to the iPhone Distribution for my enterprise account, and changed the provisioning profile to the one I created linked to the App ID I made.
I have tried so many separate combinations of things and still cannot get this sorted out.
I have also tried creating an entire new blank project from scratch and still get the same error. Here are the steps I took:
Create new App ID com.gasdcs.test
Create new distribution provisioning profile tied to com.gasdcs.test
Create new xcode project test on bundle com.gasdcs
Set all code signing identities to iPhone Distribution: My account in project and target
Set provisioning profile to the new one I had just created
Archive
There are many SO posts regarding the same issue, like this:
1 ios enterprise developer account
Application specific app id is required for InHouse. like com.yourcompany.myapp.
More SO posts here:
2 XCode export app, wildcard error
The answer is:
I have seen an announcement on Apple Developer page. Apple's WWDR Certificate was expiring and newest one available on that page. I updated that certificate and it worked!
3 Is it possible to generate Enterprise/In house Provisioning Profile of a wildcard AppID

Issues changing from wildcard to explicit app ID

I have an iOS app with four targets (iOS App, WatchKit App, WatchKit Extension, custom framework), that I want to publish for in-house usage.
Since wildcard app IDs cannot be used for in-house apps, I created four new explicit App IDs.
I also created four new provisioning profiles, where I selected the "In House" option and the new App IDs.
Then I downloaded the new provisioning profiles to XCode and configured them in my Build Settings, for each target.
I also already executed the Clean-task, deleted my Derived Data-folder and deleted / re-downloaded all provisioning profiles multiple times.
The problem is: I still get the error
"Wildcard App IDs cannot be used to create In House provisioning profiles. Please use an Explicit App ID."
when I click the Upload to App Store button or try to export the archive.
What am I missing here or what else can I try?
Please ask if you need any further information or clarification.
(I already posted this in the Apple developer forums. But since it got very few views and no answers there, I decided to crosspost.)
I got the same error message about Wildcard App IDs when trying to export.
When searching for a solution I found this: https://stackoverflow.com/a/35400712 about Apple Worldwide Developer Relations Certificate Authority certificate being expired.
Checking my certificate and seeing it was expired I followed the directions and downloaded a new certificate: https://developer.apple.com/certificationauthority/AppleWWDRCA.cer.
After removing the old certificate I was able to proceed with the export.
I had the same issue. I resolved it by importing another provisioning profile for development, in addition to the one I had imported before for release.

Keyboard Extension can no longer submit to iTunes after adding groups

I'm creating my second keyboard extension app. I've been submitting through iTunes TestFlight for testing for a couple months with no problems. But after making two changes, it no longer submits. I get the error "Failed to locate or generate matching signed assets and ailed to do so because of the following issues.
"not matching provisioning profiles found for "Applications/spkapp.app/Plugins/spk.appex"
None of the valid provision profiles allowed the specified entitlements: beta-reports-active, com.apple.security.application-groups"
The two changes I've made were to the Bundle Display Name and adding the Groups entitlement. My app ids for the extension and app both have Groups activated and set to the same group.
I've tried
1) Restoring Bundle Display Name to previous name.
2) Rebuilding all profiles several dozen times
3) Creating new profiles from scratch.
4) Refreshing profiles in Xcode, even downloading them and installing new ones and deleting the old manually.
5) Cleaning/deleting derived data/restarting Xcode/rebooting OSX
6) Comparing it to my shipping keyboard that uses the Groups entitlement. Everything matches from the entitlement files to the project settings to the provisioning profiles to the App IDs settings.
I think the problem is something to do with the Groups obviously, since it's the new addition. But I did look at Technical Q&A QA1830, but it doesn't seem helpful because I have a Store provisioning profile and it was working, so the beta-reports-active flag seems like a spurious error.
Any other suggestions?
Turns out the problem was caused by adding the Groups entitlement. Xcode creates a custom app ID for your keyboard extension, with a name starting with "Xcode iOS App ID" followed by your bundle IDs. The App ID itself will be the combined bundle ids of your app/extension as the App ID such as com.companyname.appBundleID.extensionBundleID. It's settings will match your other AppIDs, including the App Group settings.
It will also create a distribution profile for this App ID, and you need this distribution profile in order to submit to the store with groups enabled. The distribution profile will be named something like "XC: com.companyname:appBundleID.extensionBundleID". If this isn't installed when you submit to the store, you will get the error that your plugin does not have a correct profile with the groups entitlement as described above.
Note: I could submit to the story with the group entitlements disabled, so it seems this profile is only needed when you have specific entitlements enabled.
In my case, i don't know if Xcode neglected to create the distribution profile, or I deleted it when trying to clean up. To fix it I just created my own distribution profile for the Xcode App ID and named it in the same way, and ensured it was installed in Xcode 6.1 ( preferences: Apple ID view details: refresh button). And now my keyboard submits properly, with group entitlements active.

Resources