Saturday, December 21, 2013

How to move Android SDK and NDK to a different location in Windows

Today, I've encountered the problem with using Android SDK with Qt Creator. The only message I got is "C:\Program" is not recognized as an internal or external command, so I've figured that the cause of this issue are spaces in the the path (C:\Program Files\Android\).

The moving process is very simple:


First, move your SDK directory into the destination folder (I will move entire Android directory to the root of C:\ drive, so my Android SDK path will look like C:\Android\android-sdk).

If you have only SDK, moving it is usually enough! However, if you have NDK installed, the next thing is to update you environment variables. Open Command Prompt and type control.exe sysdm.cpl. Open tab Advanced and click on Environment Variables.... Find ANDROID_NDK_ROOT variable, click Edit, and change it to reflect the new path (C:\Android\android-ndk in my case). Close all dialogs (by clicking the OK button) and you're ready to go!