Test Flight Error: Invalid IPA: missing embedded provisioning profile - How do I fix this? - ios

I'm trying to package my app up and distribute an ad hoc version via Test Flight. I've already packaged and submitted the app to the app store so I'm trying to figure out which settings I need to change to make it work for ad hoc.
When I try to upload my .ipa in Test Flight I get "Invalid IPA: missing embedded provisioning profile"
I tried following the instructions from Test Flight here: http://support.testflightapp.com/kb/tutorials/how-to-create-an-ipa-xcode-4 But there isn't even in option of "Code Signing" for me in Xcode (v4.2).
I've created an ad hoc provisioning profile and downloaded it into Xcode.
I've changed the code signing identity in build settings (for both target and project) and after archive I've attached the ad hoc provisioning profile when sharing the .ipa.
I'm still getting the error. Any thoughts on what else I might need to do?
Thanks.

The entitlements pane is now in project properties -> summary.

I would try cleaning your app, and re-archive. Make sure that Xcode recognizes your AdHoc profile. It can be quite the pain in the ass to get Xcode to pick up your profile due to conflicts in your keychain. Open Organizer, select Provisioning Profiles, and make sure your AdHoc profile doesn't have any issues. If it does, you will probably need to clear out your keychain and profiles and start nice and clean. I have a post on SO that might help you. Use Device Instead of Simulator
If you aren't having any issues with your profiles, try and just attach it after you upload your ipa file to TestFlight.

For anyone who is still experiencing this error:
I was experiencing this issue with XCODE 4.3.
1 . Make sure you have a Ad-Hoc Cert :
YouTube Tutorial
After Archiving and Selecting the Distribute via Ad-Hoc option, Make sure that you Update your list of keys. The option is at the bottom of the list. And select the Ad-Hoc cert if you just had to create one.
i.e. Product > Archive > Distribute > "Save for Enterprise or Ad-Hoc Deployment" >
Next > Code Signing Identity ** Refresh Code Signing identity **

If you are planning on distributing your application via TestFlight you will need an Ad-Hoc provisioning profile generated through your Apple Developer account.
Every application I build has at least 2, often 3, different provisioning profiles assigned to them.
Development
Ad-Hoc for outside testing
Distribution

Related

Xcode 6 - Can't pick signing certificate/provisioning profile for Ad-Hoc distribution. Always taken default

To distribute the app we are using Xcode 6.0.1, where we encountered some issues by using the following process:
Added App-Id and distribution provision profile under developer program.
Chose provision profile under build settings and Archive application.
Chose Export option to do Ad-HocDistribute.
But with Xcode 6.0.1, this workflow was changed a bit. I couls still select the Ad-Hoc distribution option, but I cannot select the provisioning profile which I have created under developer program against my App-ID. There were no listing of provisional profile as we use to do in Xcode 5 version.
The Xcode 6.0.1 has tried to match the provisional profile from the dev-program and it returns message as no matching certificate and it automatically created identity as XC Ad Hoc * profile. Once I chose the Export option the XC Ad Hoc* profile has been created automatically under the distribution provision profile option in dev-program.
Under the provision profile all devices has been selected which I have added and listing total devices under my testflight application. Please assist me how to choose my provision profile which I have already created specifically for my application. Its really consume my whole day.
Xcode wanted to automatically sign with the default "XC com.*" wildcard provisioning profile instead of the explicit profile that already had.
To fix this, I just re-generated the profile on the Apple Developer Portal:
1) Go to developer.apple.com and find the distribution provisioning profile you want to use.
2) Select it, click "Edit", re-name the profile, and click "Generate".
3) Download the provisioning profile to the Desktop and drag it onto the Xcode 6 icon.
4) Re-start Xcode 6.
5) Open the organizer window and click "Submit" on the archive you built. Xcode will automatically pick your explicit profile instead of the generic one.
In Xcode 7 try to select "Use local signing assets" when selecting team. In my case it automatically selected custom Ad-Hoc profile, instead of XC Ad-Hoc*
It's quite tricky but in your app build settings, you don't have the good provisioning and/or the good code signing identity for the archive mode (RELEASE) and maybe be the bad team too. You have to re set all this things and re archive. You know it's good when Xcode show the good certificate.
Hope you will export your application.
Organizer -> Export worked for me as Organizer -> Upload to App Store and Validate were picking Xcode generated provisioning every-time.
Similar topic discussed here.

XCode 6 and Ad-Hoc distribution without XC: provisioning

Yesterday I've downloaded Xcode 6 and now I have got a problem I can't solve. In my member center I've got valid certificate and ad-hoc provisioning (distribution). Till yesterday, in Xcode 5 if I wanted to add my .ipa to TestFlight I was using Archive and selecting my valid ad-hoc profile. I wasn't even logged in in my developer account in Xcode.
Now - in Xcode 6 - nothing is working at all. Ok, I've logged in preferences, Xcode downloaded all my provisionings on Mac, but whenever I choose Export it says that I don't have matching provisioning profile and it's creating new provisioning profile with XC: prefix - which I don't want to use, because it contains all devices I have in member center - even those I don't want to include in my app!
I was trying everything from this threads:
Xcode 6 - How to pick signing certificate/provisioning profile for Ad-Hoc distribution?
Xcode 6 GM creating archive
but nothing is working for me. Maybe I don't understand correctly how it works and there is a trick I have to do but I would like to use provisioning profile defined by me. I was trying to create new provisioning profile, rename the old one, remove all from Mac, drag provisioing profile from desktop to Xcode icon, select correct Provisioning Profile in Build Setting all over again but I'm stuck.
Screenshots here:
My Ad-hoc profile is distribution profile.
There is no way to get Xcode 6.x to use an ad-hoc profile that doesn't contain all of the devices on your team; this is by design.
I have a workaround for this that works for me.
I have both Xcode 6 and Xcode 5.1.1 installed, Xcode 6 is in Applications and Xcode 5.1.1 is in another directory. When I want to do a build I use Xcode 6 to create the Archive. But you can also see the created Archive in Xcode 5.1.1 so I use Xcode 5.1.1 to distribute the Ad Hoc .ipa using the provisioning profile that I want to use. So build using Xcode 6 but distribute using Xcode 5.1.1. It works for me.
Xcode6 will now always create a new AdHoc provisioning profile prefixed with 'XC' when you export an archive for testing (e.g. Hockey App). In order to do this you must always have the latest App Store Distribution certificate and private key in your keychain.
NOTE: You do not have to have this latest distribution certificate selected in your provisioning profile you built the archive with. Also keep in mind you do not need to have an AdHoc provisioning profile to export an AdHoc ipa.
When you export the first time you will probably receive an error saying that you do not have an AdHoc provisioning profile with the following devices/people in it. Just hit 'Try Again' and it will work.
Something else to keep in mind is that when exporting an ipa you are forced to test push notifications through their distribution/production servers as it is using the new self generated 'Distribution XC: AdHoc' provisioning profile.
If you are using Urban Airship like we are you can no longer use development keys for testing. If you look under 'Entitlements' once you get through the steps to export it will show you that 'aps-environment' is set to 'production'. If anyone finds an alternate solution for this let me know.
I was facing similar issue with my distribution license, and the problem was there was "XC" provisioning profile which had the exact same bundle id.
My solution to his was to delete this XC: provisioning profile both from Apple Developer Portal and Xcode -> Preferences -> Apple ID -> View Details -> XC: provisioning profile -> right click Go To Finder -> delete
Hope this helps,
I encountered the same issue. On one of the StackOverflow threads you linked to, a solution was recently added that worked for me.
After you have created the archive, you can export it with a specific provisioning profile from the command line:
xcodebuild -exportArchive -archivePath "~/Library/Developer/Xcode/Archives/{some-date}/{appname date, time.xcarchive" -exportPath {appname} -exportFormat ipa -exportProvisioningProfile "{provisioning profile name}"
Note that the provisioning profile name is just the name, without any path or file extension.
I ran into this today as well.
I ended up removing the XC profile from the developer portal and recreating my other ad-hoc and app store profiles and downloading them again.
After I did this, when I built and tried to submit to app store, the correct App Store profile showed up AND when I went to export for ad-hoc, the correct ad-hoc profile showed up.
Yay ;)
I hit a similar problem and discovered that even if you specify the correct profiles in Xcode the Xcode6 system wants you to have the latest (from member centre) provisioning profile (for each team your account is against). It seems to walk each one in turn before using the one you need and gets blocked if you are absent any provisioning profile for the teams you belong to.
I ran into this.
No solution here worked.
I ended up moving to a command line build using nomad cli shenzen. Its another great open source project by mattt
Now I go into a shell and just type:
ipa build
DONE
They even have options to send the ipa to whatever Ad Hoc service you want. Awesome.
In Xcode 6 (at least 6.1 I am using now)when you are doing the export for ad hoc, xcode 6 will automatically scan if there is any provisioning profile contains all devices registered in the developer account and at the same time match the bundle ID. If no, it will use XC provision profile. Therefore, if you want to use your own profile, for example, for the purpose of push notification, you will need to select all devices in your profile on apple developer portal. I guess that's the reason why some people recreate profile would work and some wouldn't.
My way is much simpler:
I go to the developer - provisioning profiles and re-create my Ad Hoc profile by choosing 'Edit' then 'Generate', download it and install with double-click. When exporting .ipa the correct (mine) profile is chosen.
Apple only uses the last built provisioning profile, obviously.

Issue with signing app with wildcard profile

I developed an iPad application to a client. My client has Apple Enterprise license. But they dont allow me to sign the app with their certificate. They just ask me to provide .xarchive file so that they can sign the app and create the ipa file.
This is how I have done that
1. Create a appid with com.mycompany.myapp.abc
2. Create a adhoc profile using above appid with my developer portal
3. set the bundle ID of my app com.mycompany.myapp.abc
4. Set the code signing identity to above profile in my app's target
5. archive the file using xcode 4.6.1
6. export the xarchive file and send to the client
7. Ask client to create a inhouse Dis profile with com.mycompany.myapp.* appid
8. Ask client to open the xarchive file using xcode and sign the app with inhouse profile and create the ipa file
They have followed above instructions in 7,8 and have created the ipa file. But when we try to install the ipa file using xcode to a device it gives following error.
Does above procedure has any problem. Can some one explain the issue.
EDIT:
for testing purpose I created adhoc profile with com.mycompany.* and created an ipa file by signing above xarchive file, it gives the same error message. But If I sign the xarchive file with profile crated with com.mycompany.myapp.abc bundle id works fine.
TL;DR:
Find out what the client's (provisioning profile's) entitlements are and make sure you match them.
The error is trying to say that the entitlements in your provisioning profile and their provisioning profiles differ. The difference could be a keychain group, push notification environment or something else.
The reason why Xcode asks you to choose a provisioning profile twice (once when archiving, once when distributing) is that all the provisioning profile entitlements are picked up in archive stage and mostly ignored in the distribution stage.
This makes it all too easy to distribute with the wrong entitlements, especially if your archive stage accidentally picked up a wildcard profile. Not your case, but that's why you should burn wildcard profiles with fire.
There are clever re-signing scripts (a.k.a. "Distribute..." button replacements) that will try to make the entitlements right by mashing what they find in the end user provisioning profile into your binary but I think the best solution is to make sure your provisioning profile's entitlements and any extra entitlements you add to your app matches their provisioning profile's.
I find Xcode's provisioning profile/entitlement system to be error prone. On hand you have entitlements that are basically part of your app's identity and may as well be set in stone (TODO: make your CI server check them). And on the other hand you have Xcode's build phase gleefully changing your app's entitlements based on its automatic/random provisioning profile selection. Silly.
You should follow the below step to make adhoc distribution .ipa for client
set bundle identifier in target info.plist
select the ad hoc distribution profile in target as well as in project
select iOS device then product-> archieve
organizer will pop up then select the archive and select "distribute" -> Adhoc Enterprise distribution
select the correct ad hoc distribution profile then save this .ipa file.
then send it to the client and let him know that before archiving or building the app we need correct adhoc provisioning profile . so there is no need to repeat the process at your end to set the provisioning or other stuff just distribute it .
How to distribute your iOS app over the air:
Just need to place the .ipa file and plist on a server and set the path in the above link example.

Ad hoc distribution: failed to install app

I'm developing an ios app (only for iphone) and trying to have other people test it. I have no problem installing the app on my own device through Ad hoc distribution. When I tried installing on another person's device, it always failed with the message "xxxxx could not be installed at this time". I'm using xcode 5.
Here are the steps that I followed:
Add the device's UDID to the existing Ad hoc provisioning profile in the developer portal
Download that provisioning profile and drag that to the xcode organizer
Under code signing->provisioning profile->release, choose the Ad hoc provisioning profile. Under code signing identity->release, choose the distribution certificate from the Ad hoc profile. I set the provisioning profile (debug) to none and set the code signing identity(debug) to 'don't code sign'.
Build the app and create an archive.
Click the Distribute button in Organizer. Choose "Save for Enterprise or Ad Hoc deployment" and then select the Ad hoc provisioning profile.
Click export and check "save for enterprise distribution". Fill in the application url and title.
Upload the ipa and plist file to a server. Create an index page which contains a link to the plist file. The link looks like this:
Install Application
Send the url of the index page to the tester.
Did I miss anything? I tried deleting all the provisioning profiles on my phone and then had no problem installing the app by clicking the "Install Application" link. One weird thing that I noticed was that the status of the ad hoc provisioning profile installed on the other person's iphone was "Valid signing identity not found", as well as the team shown as "unknown". I saw somebody mentioned "Code signing entitlements". Does that matter if I leave that empty?
Couple of things to try out:
Check that the UDID you added to the portal is ticked for use under the AdHoc provision. When adding a new UDID it's possible to forget to manually update the provision profile with the new UDID.
Don't create the link yourself and don't use a plist. Just drag the ipa you created to a site like http://www.diawi.com/ and share that link with your tester.
Good Luck
You might want to check that the app bundle identifier in Xcode project is identical to that on Apple Developer portal. App bundle ids are case-sensitive.
Here's a question and more answers about a similar installation issue.

XCode--When do I sign with developer provisioning profile vs distribution profile?

I am trying to prepare my app in Xcode 4.6 for enterprise deployment. I am getting this error: "failed to get the task for process 5057".
Under the project's build settings' Code signing identity section, I have selected the iPhone Distribution provisioning profile that I made for my app (it is valid). I did not select the development provisioning profile as my identity, b/c I'm trying enterprise distribution.
But of course, I get the error "failed to get task for process 5057". Why am I getting this error? I know that the fix is to use the development provisioning profile, but why--I want to prepare my app for distribution.
Should I have two schemes for my app, one for development and one for release? And inside the dev scheme, I use my dev provisioning profile and inside my release build settings, I use my distribution provisioning profile?
XCode has made this very confusing.
Failed to get task sounds like you're trying to run this build via Xcode on device. If that's the case, you want to use a development profile, not a distribution profile (AdHoc). If you're attempting to create an enterprise release build, you'll want to select your target and choose the iOS device option, then use Product > Archive to create a release build.

Resources