Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Why not search for ANDROID_HOME first?

Open
#85 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
52/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, csharp
Domain
tooling

Research direction

Start in AndroidSdk/SdkLocator.cs at the PreferredPaths method, then compare its environment-variable order with the linked Android Studio Environment variables guidance. Determine the intended precedence for ANDROID_HOME and ANDROID_SDK_ROOT, simplify the method if appropriate, and confirm that the resulting paths preserve the expected SDK lookup behavior.

Written by the indexing model from the issue text.

Description

According to Android Studio's Environment variables page, ANDROID_SDK_ROOT is deprecated, so I am curious why in the PreferredPaths method under SDKLocator.cs, you search for in ANDROID_HOME before ANDROID_SDK_ROOT? Also, seems like that method could be simplified as follows.

Image
public override string[] PreferredPaths()
{
	var items = new List<string>
	{
		"ANDROID_HOME",
		"ANDROID_SDK_ROOT"
	};
	var paths = new List<string>();
	var config = IsWindows
		? MonoDroidSdkLocator.ReadRegistry()
		: MonoDroidSdkLocator.ReadConfigFile();
	
	if (!string.IsNullOrEmpty(config.AndroidSdkPath)) paths.Add(config.AndroidSdkPath);

	paths.AddRange(items.Select(Environment.GetEnvironmentVariable).Where(path => !string.IsNullOrEmpty(path))!);
	return paths.ToArray();
}
Dominant language
C#
Stars
78
Forks
18
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Redth/AndroidSdk.Tools

All issues in Redth/AndroidSdk.Tools

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.