From ebf91c355d0619fb910f6f40e08b62c14b8ac8b9 Mon Sep 17 00:00:00 2001 From: Ioannis <70578756+IoannisFMG@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:05:57 +0200 Subject: [PATCH] Now disregarding already set AndroidSdkRoot if SdkUseEmbedded is enabled In fresh Unity installations the `AndroidSdkRoot` editor pref is not set. They rather default to `SdkUseEmbedded` set to true. Before the fix, we were unable to build unless an SDK path was explicitly set, even if the "Use Embedded SDK" option was enabled. Facebook SDK was not allowing to export a project without an Android SDK Root path explicitly set. --- Facebook.Unity.Editor/android/FacebookAndroidUtil.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Facebook.Unity.Editor/android/FacebookAndroidUtil.cs b/Facebook.Unity.Editor/android/FacebookAndroidUtil.cs index cc9ee2ea..d24bd98c 100644 --- a/Facebook.Unity.Editor/android/FacebookAndroidUtil.cs +++ b/Facebook.Unity.Editor/android/FacebookAndroidUtil.cs @@ -123,7 +123,7 @@ public static string GetAndroidSdkPath() { string sdkPath = EditorPrefs.GetString("AndroidSdkRoot"); - if (string.IsNullOrEmpty(sdkPath) || EditorPrefs.GetBool("SdkUseEmbedded")) + if (EditorPrefs.GetBool("SdkUseEmbedded") || string.IsNullOrEmpty(sdkPath)) { try {