C++ Project Fail package to Android

I just converted my project to a C++ project. I can build and run the project in Visual Studio. I can build and compile the project in the editor without any issues. I can package to Win64, no problem. But as soon as I try to package to Android ETC1, it fails.

When it was a BP only project, I was able to build to Android without any issues. The only difference between this project and BP only project, is that I added the Victory BP plugin.

Here’s part of the log that specifies my error. It seems that it’s missing something

C:\Users\Marc-Andre\Google
Drive\Hangar
74\UE4\Bengal\Intermediate\Build\Android\Bengal\Development/UELinkerFixups.cpp:615:
error: undefined reference to
‘EmptyLinkFunctionForStaticInitializationSettings()’

Thus it cannot create

ERROR: UBT ERROR: Failed to produce
item: C:\Users\Marc-Andre\Google
Drive\Hangar
74\UE4\Bengal\Binaries\Android\Bengal-armv7-es2.so

Here’s the last portion of my log file.

MainFrameActions: Packaging (Android
(ETC1)): UnrealBuildTool: [11/14]
clang++.exe VictoryISM.cpp [armv7-es2]
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool:
[12/14] clang++.exe
VictoryBPLibraryModule.cpp [armv7-es2]
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool:
[13/14] arm-linux-androideabi-ar.exe
VictoryBPLibrary-Static-armv7-es2.a
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool:
C:/NVPACK/android-ndk-r9c\toolchains/arm-linux-androideabi-4.8\prebuilt/windows\bin/arm-linux-androideabi-ar.exe:
creating C:/Users/Marc-Andre/Google
Drive/Hangar
74/UE4/Bengal/Plugins/VictoryPlugin/Binaries/Android/VictoryBPLibrary-Static-armv7-es2.a
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool:
[14/14] clang++.exe
Bengal-armv7-es2.so
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool:
C:\Users\Marc-Andre\Google
Drive\Hangar
74\UE4\Bengal\Intermediate\Build\Android\Bengal\Development/UELinkerFixups.cpp:615:
error: undefined reference to
‘EmptyLinkFunctionForStaticInitializationSettings()’
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool:
clang++.exe: error: linker command
failed with exit code 1 (use -v to see
invocation)
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool:
-------- End Detailed Actions Stats -----------------------------------------------------------
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool:
ERROR: UBT ERROR: Failed to produce
item: C:\Users\Marc-Andre\Google
Drive\Hangar
74\UE4\Bengal\Binaries\Android\Bengal-armv7-es2.so
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool:
Cumulative action seconds (4
processors): 0.00 building projects,
176.19 compiling, 0.00 creating app bundles, 0.00 generating debug info,
57.63 linking, 0.00 other
MainFrameActions: Packaging (Android (ETC1)): UnrealBuildTool: UBT
execution time: 137.19 seconds
MainFrameActions: Packaging (Android (ETC1)): CommandUtils.Run:
Run: Took 137.3267136s to run
UnrealBuildTool.exe, ExitCode=2
MainFrameActions: Packaging (Android (ETC1)): ErrorReporter.Error:
ERROR: AutomationTool error: Command
failed (Result:2): C:\Program
Files\Epic
Games\4.7\Engine\Binaries\DotNET\UnrealBuildTool.exe
Bengal Android Development
“C:\Users\Marc-Andre\Google
Drive\Hangar
74\UE4\Bengal\Bengal.uproject” -noxge
-rocket -NoHotReloadFromIDE. See logfile for details:
‘UnrealBuildTool.txt’
MainFrameActions: Packaging (Android (ETC1)):
BuildCommand.Execute: ERROR: BUILD
FAILED
MainFrameActions: Packaging (Android (ETC1)): Program.Main: ERROR:
AutomationTool terminated with
exception:
MainFrameActions: Packaging (Android (ETC1)): Program.Main: ERROR:
Exception in AutomationTool: Command
failed (Result:2): C:\Program
Files\Epic
Games\4.7\Engine\Binaries\DotNET\UnrealBuildTool.exe
Bengal Android Development
“C:\Users\Marc-Andre\Google
Drive\Hangar
74\UE4\Bengal\Bengal.uproject” -no
MainFrameActions: Packaging (Android (ETC1)): xge -rocket
-NoHotReloadFromIDE. See logfile for details: ‘UnrealBuildTool.txt’
MainFrameActions: Packaging (Android (ETC1)): Stacktrace: at
AutomationTool.CommandUtils.RunAndLog(String
App, String CommandLine, String
Logfile, Int32 MaxSuccessCode, String
Input, ERunOptions Options,
Dictionary2 EnvVars) MainFrameActions: Packaging (Android (ETC1)): at AutomationTool.CommandUtils.RunUBT(CommandEnvironment Env, String UBTExecutable, String CommandLine, String LogName, Dictionary2 EnvVars)
MainFrameActions: Packaging (Android (ETC1)): at
AutomationTool.UE4Build.BuildWithUBT(String
ProjectName, String TargetName,
UnrealTargetPlatform TargetPlatform,
String Config, String UprojectPath,
Boolean ForceMonolithic, Boolean
ForceNonUnity, Boolean ForceDebugInfo,
Boolean ForceFlushMac, Boolean
DisableXGE, String InAddArgs, Boolean
ForceUnity, Dictionary2 EnvVars) MainFrameActions: Packaging (Android (ETC1)): at AutomationTool.UE4Build.Build(BuildAgenda Agenda, Nullable1
InDeleteBuildProducts, Boolean
InUpdateVersionFiles, Boolean
InForceNoXGE, Boolean InForceNonUnity,
Boolean InForceUnity, Dictionary2 PlatformEnvVars) MainFrameActions: Packaging (Android (ETC1)): at Project.Build(BuildCommand Command, ProjectParams Params, Int32 WorkingCL) MainFrameActions: Packaging (Android (ETC1)): at BuildCookRun.DoBuildCookRun(ProjectParams Params) MainFrameActions: Packaging (Android (ETC1)): at BuildCommand.Execute() MainFrameActions: Packaging (Android (ETC1)): at AutomationTool.Automation.Execute(List1
CommandsToExecute,
CaselessDictionary`1 Commands)
MainFrameActions: Packaging (Android (ETC1)): at
AutomationTool.Automation.Process(String[]
CommandLine)
MainFrameActions: Packaging (Android (ETC1)): at
AutomationTool.Program.MainProc(Object
Param)
MainFrameActions: Packaging (Android (ETC1)): at
AutomationTool.InternalUtils.RunSingleInstance(MainProc
Main, Object Param)
MainFrameActions: Packaging (Android (ETC1)): at
AutomationTool.Program.Main()
MainFrameActions: Packaging (Android (ETC1)): Program.Main: ERROR:
Command failed (Result:2): C:\Program
Files\Epic
Games\4.7\Engine\Binaries\DotNET\UnrealBuildTool.exe
Bengal Android Development
“C:\Users\Marc-Andre\Google
Drive\Hangar
74\UE4\Bengal\Bengal.uproject” -noxge
-rocket -NoHotReloadFromIDE. See logfile for details:
‘UnrealBuildTool.txt’
MainFrameActions: Packaging (Android (ETC1)):
ProcessManager.KillAll: Trying to kill
0 spawned processes.
MainFrameActions: Packaging (Android (ETC1)): Program.Main:
AutomationTool exiting with ExitCode=2
MainFrameActions: Packaging (Android (ETC1)): Domain_ProcessExit
MainFrameActions: Packaging (Android (ETC1)):
ProcessManager.KillAll: Trying to kill
0 spawned processes.
MainFrameActions: Packaging (Android (ETC1)): copying UAT log
files…
MainFrameActions: Packaging (Android (ETC1)): RunUAT.bat ERROR:
AutomationTool was unable to run
successfully.
MainFrameActions: Packaging (Android (ETC1)): BUILD FAILED

Any reason why?

thanks

Ok It seems to be a problem with the VictoryBP plugin…

#It Is Your Responsability

It’s not an issue with my plugin, you have to set up my plugin to package with Android properly, which is not something I can do since not everyone wants to build my plugin for Android.

I’ve replied here

#Wait for 4.8

I personally recommend waiting for 4.8 since Epic has to have addressed these sort of issues while preparing for the future of selling C++ plugins on Marketplace.

Rama