I’m trying to build an installed build of a custom version of UE4.21, and it requires Android support. When building the android binaries, UEBuildAndroid.cs seems to override the system environment variables with whatever is set in the configs at /Script/AndroidPlatformEditor.AndroidSDKSettings (Line 560 of UEBuildAndroid.cs):
string path;
foreach (KeyValuePair<string, string> kvp in EnvVarNames)
{
if (GetPath(configCacheIni, "/Script/AndroidPlatformEditor.AndroidSDKSettings", kvp.Value, out path) && !string.IsNullOrEmpty(path))
{
AndroidEnv.Add(kvp.Key, path);
}
else
{
string envValue = Environment.GetEnvironmentVariable(kvp.Key);
if (!String.IsNullOrEmpty(envValue))
{
AndroidEnv.Add(kvp.Key, envValue);
}
}
}
I’ve found that in the generated Engine.ini in Engine\Programs\UnrealHeaderTool\Intermediate\Config\CoalescedSourceConfigs this is set:
[/Script/AndroidPlatformEditor.AndroidSDKSettings]
SDKAPILevel=latest
NDKAPILevel=android-19
SDKPath=(Path="C:/NVPACK/android-sdk-windows")
NDKPath=(Path="C:/NVPACK/android-ndk-r12b")
ANTPath=(Path="")
JavaPath=(Path="")
I’ve tried changing Engine\Config\BaseEngine.ini → [/Script/AndroidPlatformEditor.AndroidSDKSettings] to match what I would like to use:
SDKAPILevel=matchndk
NDKAPILevel=android-21
SDKPath=(Path="C:/NVPACK/android-sdk-windows")
NDKPath=(Path="C:/NVPACK/android-ndk-r15c")
ANTPath=(Path="C:/NVPACK/apache-ant-1.8.2")
JavaPath=(Path="C:/NVPACK/jdk1.8.0_77")
However, cleaning the intermediate folders, then doing a rebuild results in the Engine.ini being regenerated, but seems to disregard BaseEngine.ini.
I have so far been unable to find where /Script/AndroidPlatformEditor.AndroidSDKSettings is generated at build-time - does anyone know how I can override these settings for a build of the engine?