diff --git a/build/nuke/Native/SilkDroid.cs b/build/nuke/Native/SilkDroid.cs index 6ec9951a93..7975ad52dd 100644 --- a/build/nuke/Native/SilkDroid.cs +++ b/build/nuke/Native/SilkDroid.cs @@ -42,6 +42,12 @@ string AndroidHome return AndroidHomeValue; } + if ((Environment.GetEnvironmentVariable("ANDROID_HOME") ?? Environment.GetEnvironmentVariable("ANDROID_SDK_ROOT")) is {} sdk) + { + AndroidHomeOverride = sdk; + return sdk; + } + var utils = RootDirectory / "build" / "utilities"; DotNet($"build \"{utils / "android_probe.proj"}\" /t:GetAndroidJar"); AndroidHomeValue = (AbsolutePath) File.ReadAllText(utils / "android.jar.gen.txt") / ".." / ".." / ".."; @@ -86,6 +92,7 @@ string AndroidHome var envVars = CreateEnvVarDictionary(); envVars["ANDROID_HOME"] = AndroidHome; + envVars["ANDROID_SDK_ROOT"] = AndroidHome; foreach (var ndk in Directory.GetDirectories((AbsolutePath) AndroidHome / "ndk") .OrderByDescending(x => Version.Parse(Path.GetFileName(x))))