38

So I'm using testflightapp to distribute an ad-hoc build.

But I keep getting this message: 'Invalid Profile: distribution build entitlements must have get-task-allow set to false.'

I don't have an entitlements file for my App, so XCode automatically produces one and includes it in the build. I unzip the App.ipa and open up the embedded.mobileprovision file and look at the entitlement dictionary.

It looks like this:

<key>Entitlements</key>
<dict>
    <key>application-identifier</key>
    <string>E9PBH9V8TB.*</string>
    <key>get-task-allow</key>
    <false/>
    <key>keychain-access-groups</key>
    <array>
        <string>E9PBH9V8TB.*</string>
    </array>
</dict>

Anyone else experienced this before? I don't understand why I'm getting this error.

Eric J.
  • 147,927
  • 63
  • 340
  • 553
Tobias
  • 4,397
  • 3
  • 26
  • 33

11 Answers11

60

Turns out the Code-Signing Identity in my build configuration didn't match the one I selected when I saved the archive for Ad-Hoc distribution.

Tobias
  • 4,397
  • 3
  • 26
  • 33
  • Solved my problem, too, thanks! (I believe you can check your answer now.) – Matthew Frederick May 11 '12 at 01:39
  • Can you explain what this is? Where are the two different places where you specify the code singing identify? – Luis Perez Jul 16 '12 at 15:03
  • 3
    @luisperezphd In XCode 4 click the blue project icon. In the page that opens up in the sidebar you can select the project and the target, your app, both have their own build settings with their own code-signing setting. I just updated both to match what I wanted and it solved the problem. – Tobias Jul 16 '12 at 18:38
  • I always thought whatever profile you signed it with in the Archive step just overwrote anything in the build settings? well snap – anders May 19 '14 at 20:16
  • 1
    I had to do the same, but to go into more detail I had to use "iPhone Distribution: company xxx" in the release section AND set the provisioning profile to None (I think this is xcode 5 & above). Then use the provisioning profile when doing the ad-hoc distribution. – Federico May 28 '14 at 14:17
  • 1
    I had to change my code signing identity to something else, and the provisioning profile, then set them back again and it just started working again. – jowie Jun 04 '14 at 13:36
50

Heh, i suddenly found that Code Signing Identity for Release build was changed to iOS Developer. You should change it to iOS Distribution. If it doesn't fix your problem, set Provisioning profile for Release build.

Steps to fix it

It works for me. Happy coding!

Update: Sometimes XCode doesn't apply this changes and restarting of XCode could help. Anyway before uploading to Testflight I strongly recommend you to check build logs. You should find this line "Using code signing identity" and see if XCode use the right Code Identity (distribution) to sign. It could save you a lot of time.

Anton Gaenko
  • 8,929
  • 6
  • 44
  • 39
21

Oddly enough, restarting xcode, and rearchiving can help. It sure did for me. :-)

(TestFlight iOS App get-task-allow Issue)

Community
  • 1
  • 1
ullstrm
  • 9,812
  • 7
  • 52
  • 83
  • If it works before and this error just occurred, then restarting XCode (and rebooting OS) will solve the issue. – Nay May 12 '16 at 13:00
  • Shocking how often restarts work. This was making me crazy. Working on a point release and have not changed any settings other than the version – Dan Loughney Jul 14 '16 at 00:22
5

I had this issue in XCode 5. My provisioning profile was setup correctly but I didn't have an "entitlements" file. To fix this issue I selected the target application and then the "Capabilities" tab. I turned on one or two of the available options (iCloud, Game Center, Passbook, etc.) so XCode would create an "entitlements" file. After the file was created I turned off the options that I had just turned on. Again, I built and archived the project and was able to use the .ipa file with TestFlight.(see screenshot below)

enter image description here

Weston
  • 416
  • 1
  • 9
  • 17
2

I have the same problem.

If you follow the TestFlight instructions the Entitlement configuration in the Target --> Summary should be disabled.

"Scroll down and expand the Entitlements section in the Summary tab. In previous versions of Xcode, you were required to create an Entitlements file and create a get-task-allow key. This is no longer necessary. Unless your application requires special permissions surrounding iCloud or Keychain Access, you are not required to create this file. Leave the Enable Entitlements checkbox unchecked."

But doesn't works for me, hopefully works for you.

Iván Peralta
  • 851
  • 1
  • 9
  • 25
2

Most often you are signing your application with a Development Provisioning Profile.

You MUST ensure that your are signing your application with an Ad Hoc Provisioning Profile.

From Testflight web site

Lucas
  • 6,675
  • 3
  • 25
  • 43
2

I had the same problem. I logged in to the Apple Provisioning Portal and it turned out my Ad-hoc distribution provisioning profile was invalid with a yellow warning sign.

I deleted the old provisioning profile, created a new and selected it in XCode release settings. (Make sure you go to XCode Preferences, Account and refresh provisoring profiles first)

ingljo
  • 51
  • 3
0

I had the same problem. Solved it by checking and changing the identities I had used to sign the build. Fixed it for me.

fluxon
  • 538
  • 7
  • 19
0

Another thing that might work, if you don't have anything of importance in your Entitlements.plist file, is to just delete the file. Weirdly enough, this worked for me.

weienw
  • 812
  • 1
  • 8
  • 22
0

I face this issue multiple times even after setting the correct code signing in the project and target settings. I restarted the XCode, created another IPA and uploaded it to Testflight. That worked perfectly.

So I conclude it as: 1) First check if the code signing details and the provisioning profiles are correct. 2) If you still face the issue, quite XCode. Restart it and archive once again. Re upload the newly created archive and everything should be fine at this point.

shah1988
  • 2,584
  • 1
  • 19
  • 21
0

If someone encounters this issue in Xcode 7.3.1 and if a restart doesn't help, try first to Validate bunle, then to do Upload to App Store...

nsinvocation
  • 7,559
  • 3
  • 41
  • 46