Skip to content

Commit c8a5b5b

Browse files
authored
Check for ANDROID_HOME Sdk location on Windows. (#230)
For some reason we never check for the `%ANDROID_HOME%` environment variable on Windows. This might cause issues with people using VSCode since we probably will be using environment variables as a backup when using that IDE. Add a check to use `%ANDROID_HOME%` after checking the registry entries. This way Visual Studio and Android SDK Installer paths will still be preferred.
1 parent 05f9a90 commit c8a5b5b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Xamarin.Android.Tools.AndroidSdk/Sdks/AndroidSdkWindows.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ protected override IEnumerable<string> GetAllAvailableAndroidSdks ()
9393
if (CheckRegistryKeyForExecutable (root, ANDROID_INSTALLER_PATH, ANDROID_INSTALLER_KEY, wow, "platform-tools", Adb))
9494
yield return RegistryEx.GetValueString (root, ANDROID_INSTALLER_PATH, ANDROID_INSTALLER_KEY, wow) ?? "";
9595

96+
foreach (string dir in GetSdkFromEnvironmentVariables ())
97+
yield return dir;
98+
9699
// Check some hardcoded paths for good measure
97100
var paths = new string [] {
98101
Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData), "Xamarin", "MonoAndroid", "android-sdk-windows"),

0 commit comments

Comments
 (0)