Skip to content

Commit 48bd630

Browse files
committed
Check that androidSdkRootPath directory exists before using as sdkPath
Bug: 178496313 Change-Id: Ib85184e77572b75a242d55f572aa44629614555b
1 parent 46c8ff9 commit 48bd630

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/AndroidResolver/src/PlayServicesResolver.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,9 @@ public static string AndroidSdkRoot {
842842
// Unity 2019.3 added AndroidExternalToolsSettings which contains the Android SDK
843843
// path so try to use that first.
844844
var androidSdkRootPath = UnityCompat.AndroidExternalToolsSettingsSdkRootPath;
845-
if (!String.IsNullOrEmpty(androidSdkRootPath)) sdkPath = androidSdkRootPath;
845+
if (!String.IsNullOrEmpty(androidSdkRootPath)) {
846+
if (Directory.Exists(androidSdkRootPath)) sdkPath = androidSdkRootPath;
847+
}
846848

847849
// Unity 2019.x added installation of the Android SDK in the AndroidPlayer directory
848850
// so fallback to searching for it there.

0 commit comments

Comments
 (0)