# Android NDK hardcoded to use version 12b in UE4.21

**URL:** <https://forums.unrealengine.com/t/android-ndk-hardcoded-to-use-version-12b-in-ue4-21/440229>\
**Category:** Mobile\
**Tags:** ndk, build, unreal-engine, Android, Packaging, question\
**Created:** [December 28, 2018, 7:40pm UTC](https://forums.unrealengine.com/t/android-ndk-hardcoded-to-use-version-12b-in-ue4-21/440229 "2018-12-28T19:40:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CerebralFrost\_EH](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CerebralFrost\_EH](https://forums.unrealengine.com/u/CerebralFrost_EH)\
**Post date:** [December 28, 2018, 7:40pm UTC](https://forums.unrealengine.com/t/android-ndk-hardcoded-to-use-version-12b-in-ue4-21/440229/1 "2018-12-28T19:40:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6a2fb347](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6a2fb347](https://forums.unrealengine.com/u/anonymous_user_6a2fb347)\
**Post date:** [July 10, 2020, 3:51am UTC](https://forums.unrealengine.com/t/android-ndk-hardcoded-to-use-version-12b-in-ue4-21/440229/2 "2020-07-10T03:51:14Z")

</div>

download and instal sdk and ndk and jdk in this video :

---

<div class="post-metadata">

**Author:** ![incfour](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@incfour](https://forums.unrealengine.com/u/incfour)\
**Post date:** [August 18, 2021, 5:31am UTC](https://forums.unrealengine.com/t/android-ndk-hardcoded-to-use-version-12b-in-ue4-21/440229/3 "2021-08-18T05:31:47Z")

</div>

1. Intermediate, Saved delete Folder

2. C:\Users[Username]\AppData\Local\Unreal Engine\Engine\Config\UserEngine.ini Fild And AndroidSDKSettings Path delete

3. ReStart .uProject

---

<div class="post-metadata">

**Author:** ![incfour](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@incfour](https://forums.unrealengine.com/u/incfour)\
**Post date:** [August 18, 2021, 10:43am UTC](https://forums.unrealengine.com/t/android-ndk-hardcoded-to-use-version-12b-in-ue4-21/440229/4 "2021-08-18T10:43:08Z")

</div>

Another…

Engine Source ConfigCacheIni.cpp

ADD in MatchExpansions Func

```
FConfigExpansion(TEXT("%GAMEFULLDIR%"), FPaths::ConvertRelativePathToFull(FPaths::ProjectDir()))

```

ADD in CollapseValue Func

```
ExpandPathValueInline(FPaths::ConvertRelativePathToFull(FPaths::ProjectDir()), TEXT("%GAMEFULLDIR%"));

```

ADD DefaultEngine.ini

```
[/Script/AndroidPlatformEditor.AndroidSDKSettings]
SDKPath=(Path="%GAMEFULLDIR%../PlatformSDK/Android/Sdk")
NDKPath=(Path="%GAMEFULLDIR%../PlatformSDK/Android/Sdk/ndk/21.4.7075529")
JavaPath=(Path="%GAMEFULLDIR%../PlatformSDK/Android/jre")

```

_ **AndroidSDK Build is need Absolute Path. So ADD GAMEFULLDIR .** _

Intermediate, Saved delete Folder

Rebuild
