Automatic signing is unable to resolve an issue with the target's entitlements file

Create iOS for distribution failed.

env: Automatic signing is unable to resolve an issue with the "Puzzle" target's entitlements file. Remove the entitlements or switch to manual signing and resolve the issue by downloading a

provisioning profile from the developer website.

env: Provisioning profile "dis" doesn't match the entitlements file's value for the get-task-allow entitlement.

env: Code signing is required for product type 'Application' in SDK 'iOS 10.3'

env:

env: ** BUILD FAILED **


In addition,
  • only ios distribution version failed, develop version success.
  • If you project doesn’t contain c++ source code, distribution version can success. I used to try to remove all c++ source code, it can success to create a distribution version of ipa.
  • I noticed that the dev version contains get-task-allow = true, the distribution contains false. I think it is ok, but don’t understand why c ++ source code related to this
  • There there only there source files related with get-task-allow: UEDeployIOS.cs, CompileTime.cs, MobileProvisionUtilities.cs, I had reviewed but found nothing

I think it may be related to my development environment is the latest:

mac os:10.12.5

xcode:8.3.2

itune:10.12.5

ue4: 4.15.3

Error log: &nbsp[link text][1]


*I think UE4.16p3 Automatic Siging may solve my problem after some unknown operation.* But there is another problem when deliver to app store:

ERROR ITMS-90161: “Invalid Provisioning Profile. The provisioning profile included in the bundle com.noxgame.archertest [Payload/ArcherTest.app] is invalid. [Missing code-signing certificate]. A Distribution Provisioning profile should be used when submitting apps to the App Store. For more information, visit the iOS Developer Portal.”

There maybe some issue with ue4.15/4.16 and xcode 8.3.2.


Here is a relate post:

Still can't remote build iOS package from PC with distribution provision and certificate in UE 4.16! - Mobile - Unreal Engine Forums!

I have had the same problem for two weeks now and I can’t find a solution. I have have found many suggestions like renaming the provisioning profile, making sure the cert and private key are in the system keychain and not the login keychain.

It worked once when a dialog popped up in the background asking if I wanted to grant access to the keychain and it magically worked. But I only saw that popup once and it has never come up again resulting in the same error you have.

Please someone give us some hope. I have spent hours looking and trying other suggestions.

I am also on 4.16 now. Same error on 4.15.2/4.15.3

You can build via commandline to get past this issue.

/Users/Shared/EpicGames/UE_4.16/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun -nocompileeditor -nop4 -project=/Users/username/project/project.uproject -cook -stage -archive -archivedirectory=/Users/username/Desktop/Build -package -clientconfig=Shipping -ue4exe=UE4Editor -clean -compressed -pak -prereqs -distribution -nodebuginfo -targetplatform=IOS -build -CrashReporter -utf8output

Thank your! It works.

Ever since running this command (with all the stuff filled out) any attempt to package my project fails instantly. I would advise against it.

The proper fix to the issue to fix UnrealBuildTool:

For some reason bForDistribution param to the function that writes the entitlements file is hardcoded to false.
Replacing it with “InTarget.Configuration == UnrealTargetConfiguration.Shipping” solves the issue.
This parameter is used to write “get-task-allow” value to true or false.

In Engine\Source\Programs\UnrealBuildTool\Platform\IOS\UEDeployIOS.cs on line 1098:

if (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Mac && Environment.GetEnvironmentVariable("UBT_NO_POST_DEPLOY") != "true")
{
	//REPLACE
	// return PrepForUATPackageOrDeploy(InTarget.Configuration, InTarget.ProjectFile, GameName, ProjectDirectory, BuildPath + "/" + DecoratedGameName, "../../Engine", **false**, "", false, InTarget.bCreateStubIPA, InTarget.BuildReceiptFileName);
	
	// WITH
	return PrepForUATPackageOrDeploy(InTarget.Configuration, InTarget.ProjectFile, GameName, ProjectDirectory, BuildPath + "/" + DecoratedGameName, "../../Engine", 
	InTarget.Configuration == UnrealTargetConfiguration.Shipping, // not hardcoded
		"",  false, InTarget.bCreateStubIPA, InTarget.BuildReceiptFileName);
}

This bug should be raised to as a bug to UE4.

Hi! Good job on finding this, however the problem persists when i’m trying to build (not deploy), perhaps there is a similar problem somewhere else, like UEBuildOS.cs ?

Hi, Actually,

The “For Distribution” project setting should be passed in there.
I opened a bug to UE. Let’s see.

Hey, any updates on this issue?

Great job finding this, but I’m still running into the same error after making the change you mentioned. For distribution is checked in my project settings. Any ideas?

My project packages in development build without issues.

Are you sure that both Mobile Provisioning and Certificate are set for distribution and that they are checked?

I am also experiencing this same issue. I am using 4.21 and Xcode 10.1 (Apple requires you do have xcode 10.1 as of march 1st to upload to app store/test flight).

It’s odd, I tried re-changing all of those settings and got a package ALMOST built. It went through the packaging process for about 10 minutes and downloaded a ton of plugins, but unfortunately, it eventually started deleting all the stuff it downloaded and gave me an error with exit code 23.

Unfortunately, after that lone package attempt I’ve been unable to pass the error that the OP asked (even though I have all the same settings as I did during my initial package attempt). Here’s the error I get and my settings:

270448-settings.png

Any ideas?

Ok, this has now been marked as resolved, however the commit is targeted to 4.22 and doesn’t seem to be featured in the release branch yet. I’m hoping it will merge onto the release branch soon as I don’t want to be running an unstable version of the engine, nor to try to implement this commit in isolation and potentially create other problems.