Error while packaging even empty project (iOS)

After update 4.22.1 I can’t build even absolutely empty c++ project. Worse with every new release…

Project.Package: ********** PACKAGE COMMAND STARTED **********
IOSPlatform.Package: Package /Users/corvisalex/Documents/UnrealProjects/MyProject/MyProject.uproject
UnrealPluginLanguage.Init: UPL Init: None
Log.WriteException: ==============================================================================
Log.WriteException: ERROR: System.NullReferenceException: Object reference not set to an instance of an object
Log.WriteException:          at Tools.DotNETCommon.FileSystemReference.CombineStrings (Tools.DotNETCommon.DirectoryReference BaseDirectory, System.String[] Fragments) [0x00047] in <085be0bc00f949cb96d5902ac1676522>:0 
Log.WriteException:          at Tools.DotNETCommon.FileReference.Combine (Tools.DotNETCommon.DirectoryReference BaseDirectory, System.String[] Fragments) [0x00000] in <085be0bc00f949cb96d5902ac1676522>:0 
Log.WriteException:          at IOSPlatform.WriteEntitlements (AutomationTool.ProjectParams Params, DeploymentContext SC) [0x000a5] in <16fb4bc5a573476dbe4cf507da746cc6>:0 
Log.WriteException:          at IOSPlatform.Package (AutomationTool.ProjectParams Params, DeploymentContext SC, System.Int32 WorkingCL) [0x00457] in <16fb4bc5a573476dbe4cf507da746cc6>:0 
Log.WriteException:          at Project.Package (AutomationTool.ProjectParams Params, System.Int32 WorkingCL) [0x000bc] in <2d06b1c78c30473983e756542991f787>:0 
Log.WriteException:          at BuildCookRun.DoBuildCookRun (AutomationTool.ProjectParams Params) [0x00094] in <2d06b1c78c30473983e756542991f787>:0 
Log.WriteException:          at BuildCookRun.ExecuteBuild () [0x00040] in <2d06b1c78c30473983e756542991f787>:0 
Log.WriteException:          at AutomationTool.BuildCommand.Execute () [0x00001] in <12df2f08c3b644f29f037eda010f02c3>:0 
Log.WriteException:          at AutomationTool.Automation.Execute (System.Collections.Generic.List`1[T] CommandsToExecute, System.Collections.Generic.Dictionary`2[TKey,TValue] Commands) [0x0007c] in <12df2f08c3b644f29f037eda010f02c3>:0 
Log.WriteException:          at AutomationTool.Automation.Process (System.String[] Arguments, UnrealBuildTool.StartupTraceListener StartupListener) [0x0026f] in <12df2f08c3b644f29f037eda010f02c3>:0 
Log.WriteException:          at AutomationTool.Program.MainProc (System.String[] Arguments, UnrealBuildTool.StartupTraceListener StartupListener) [0x00001] in <0237adef54404c48b8fc24e3cc3bd2ab>:0 
Log.WriteException:          at AutomationTool.Program+<>c__DisplayClass1_0.<Main>b__2 () [0x00000] in <0237adef54404c48b8fc24e3cc3bd2ab>:0 
Log.WriteException:          at AutomationTool.InternalUtils.RunSingleInstance (System.Func`1[TResult] Main) [0x000a0] in <12df2f08c3b644f29f037eda010f02c3>:0 
Log.WriteException:          at AutomationTool.Program.Main (System.String[] Arguments) [0x0020a] in <0237adef54404c48b8fc24e3cc3bd2ab>:0 
Log.WriteException:        (see /Users/corvisalex/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://epicsupport.force.com/unrealengine/s/

Thanks

We have exactly the same problem. Also tested on an empty c++ project. Build fails for iOS with the same log as above.

I found! It’s a problem with auto signing.
It comes from IOSPlatform.Automation.cs, method WriteEntitlements:

FileReference MobileProvisionFile = FileReference.Combine(MobileProvisionDir, Params.Provision);

Combine called without any check. But Params.Provision always null if auto signing is enabled according to the following code (IOSExports.cs):

	public static void GetProvisioningData(FileReference InProject, bool Distribution, out string MobileProvision, out string SigningCertificate, out string TeamUUID, out bool bAutomaticSigning)
	{
		IOSProjectSettings ProjectSettings = ((IOSPlatform)UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.IOS)).ReadProjectSettings(InProject);
		if (ProjectSettings == null)
		{
			MobileProvision = null;
			SigningCertificate = null;
			TeamUUID = null;
			bAutomaticSigning = false;
			return;
		}
		if (ProjectSettings.bAutomaticSigning)
		{
			MobileProvision = null;
			SigningCertificate = null;
			TeamUUID = ProjectSettings.TeamID;
			bAutomaticSigning = true;
		}
		else
		{
			IOSProvisioningData Data = ((IOSPlatform)UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.IOS)).ReadProvisioningData(ProjectSettings, Distribution);
			if (Data == null)
			{ // no provisioning, swith to automatic
				MobileProvision = null;
				SigningCertificate = null;
				TeamUUID = ProjectSettings.TeamID;
				bAutomaticSigning = true;
			}
			else
			{
				MobileProvision = Data.MobileProvision;
				SigningCertificate = Data.SigningCertificate;
				TeamUUID = Data.TeamUUID;
				bAutomaticSigning = false;
			}
		}
	}

Hey, B REX, you can try to disable auto signing in iOS settings. It solved my problem.

Thanks, that worked!

I was having the same issue and disabling auto-signing did fix it.

But is that the optimal way to go? I’m not exactly sure what auto-signing does and if it’s ideal to have it turned on or not