39
votes

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.

11

11 Answers

60
votes

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.

51
votes

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.

21
votes

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

(TestFlight iOS App get-task-allow Issue)

5
votes

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

2
votes

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.

2
votes

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

2
votes

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)

0
votes

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

0
votes

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.

0
votes

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.

0
votes

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...