Android Packaging results in clang++.exe error

This is the relevant Output Log:

UATHelper: Packaging (Android (ATC)): UnrealBuildTool: [4/4] clang++.exe RobotDefenseCPP-armv7-es2.so
UATHelper: Packaging (Android (ATC)): UnrealBuildTool: C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime/Core/Public\Android/AndroidMisc.h:143: error: undefined reference to 'ABirdsEyePawn::MinBirdsEyeZoomIn'
UATHelper: Packaging (Android (ATC)): UnrealBuildTool: C:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime/Core/Public\Android/AndroidMisc.h:143: error: undefined reference to 'ABirdsEyePawn::MaxBirdsEyeZoomOut'
UATHelper: Packaging (Android (ATC)): UnrealBuildTool: clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
UATHelper: Packaging (Android (ATC)): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: C:\Users\alljo\Documents\Unreal Projects\gameCPP\RobotDefenseCPP\Binaries\Android\RobotDefenseCPP-armv7-es2.so
UATHelper: Packaging (Android (ATC)): UnrealBuildTool: Total build time: 166,48 seconds
UATHelper: Packaging (Android (ATC)): CommandUtils.Run: Run: Took 166,675688s to run UnrealBuildTool.exe, ExitCode=5

ABirdsEyePawn is a class, that I created and derives from ASpectatorPawn. MaxBirdsEyeZoomOut and -In are declared like this in the header file:

public:
	static constexpr float MaxBirdsEyeZoomOut = 3.0f;
	static constexpr float MinBirdsEyeZoomIn = 0.1f;

The only place, that these variables are used is in the following function:

void ABirdsEyePawn::UpdateZoom(float DeltaTime)
{
	if (!ensure(SpringArm1)) { return; }

	uint8 HalfStepNumber = ZoomingSteps / 2;
	float Multiplicator = FMath::Lerp(
		1.f,
		(CurrentZoom > 0.f ? MaxBirdsEyeZoomOut : MinBirdsEyeZoomIn),
		FMath::Abs(FMath::RoundToFloat(CurrentZoom) / (float)HalfStepNumber)
	);

	UpdateSpringArmLength(SpringArm1, DefaultArm1Length * Multiplicator, DeltaTime);
}

It would be great if anyone could help. I will update this post or leave a comment if I find out anything new regarding the issue.

Funnily enough, if I replace the line

(CurrentZoom > 0.f ? MaxBirdsEyeZoomOut : MinBirdsEyeZoomIn),

inside ‘ABirdsEyePawn::UpdateZoom(float DeltaTime)’ with

(CurrentZoom > 0.f ? 3.0f : 0.1f),

the game packages successfully.

Edit: If I change it back to (CurrentZoom > 0.f ? MaxBirdsEyeZoomOut : MinBirdsEyeZoomIn), packing fails again.

Edit2: Similarly if I change

float Multiplicator = FMath::Lerp(
	1.f,
	(CurrentZoom > 0.f ? MaxBirdsEyeZoomOut : MinBirdsEyeZoomIn),
	FMath::Abs(FMath::RoundToFloat(CurrentZoom) / (float)HalfStepNumber)
);

to:

float MinMaxZoomValue = CurrentZoom > 0.f ? MaxBirdsEyeZoomOut : MinBirdsEyeZoomIn;
float Multiplicator = FMath::Lerp(1.f, MinMaxZoomValue, FMath::Abs(FMath::RoundToFloat(CurrentZoom) / (float)HalfStepNumber));

Packaging completes successfully, too.

Hey AllJonasNeeds,

Sorry for the delay. Would you mind providing the full output log after the packaging failure occurs again?

No problem, .

I’ve spent some time testing this, and in an attempt to come up with a simplified repro, here’s what I did:

Created two static constexpr float variables named the same as yours.

Executed this line:

(CurrentZoom > 0.f ? MaxBirdsEyeZoomOut : MinBirdsEyeZoomIn)

But when I packaged I received no errors. Could you try to reproduce this issue in a clean project in its simplest form and provide me with a list of repro steps?

Thanks

Like Flint I am unable to reproduce the issue in a clean project, so I would check this off as on of those ghost in the machine bugs, where there is an anomaly in my CPU on a subatomic level or something along those lines. So unless I would send you my PC, you probably would not be able to reproduce the issue.

If anyone has a similar problem, I would advise you to slightly alter your code without changing functionality. As you can read in the comments, small changes let me circumvent the problem.