Android SDK location reset after restart

I have to set Android SDK location in Preferences every single time after restarting my computer. I have the following setup:

  • Unity 2019.2.12f1 installed under C:\Program Files\Unity

  • Android and iOS support installed

  • No Unity Hub installed

  • Android SDK installed under D:\Android

  • Android NDK installed under D:\Android\android-ndk-r16b

Here are my environment variables:


and PATH:

When I start up Unity and open Preferences, the Android SDK is set to c:\android-sdk-windows and Android NDK is set to C:/android-sdk-windows/android-ndk-r16b. When I hit “Browse” for the SDK, a pop up notifies that “Unity has detected Android SDK at ‘D:\Android’. Do you want to use this SDK directory?”. The NDK is not automatically detected, and I have to manually browse the location. The locations I set are saved even if I close Unity Editor, but when I reboot the computer the settings are reset.

The preferences are stored in the registry key. Maybe your computer restores registry from backups after the restart or does something similar to that? Maybe antivirus software or antimalware software does this.

1 Like

The registry keys are under HKCU\Software\Unity Technologies\Unity Editor 5.x, correct? The SDK path seems to be stored in AndroidSdkRoot_* and NDK is path is stored under AndroidNdkRoot*.

yes, that should be correct.

Were you able to fix this? Im having the same problem right now but in my case even if set the correct path for sdk, it still says system has sdk of api level 0 and its bugging me so much.

You seem to have a different issue. Did you follow the setup guide? For 2019.3 https://docs.unity3d.com/Manual/android-sdksetup.html or if you are using 2018.4 then https://docs.unity3d.com/2018.4/Documentation/Manual/android-sdksetup.html