Android SDK location should not contain whitespace, as this cause problems with NDK tools

156,358

Solution 1

As the warning message states, the SDK location should not contain whitespace.

Your SDK is at C:\Users\Giacomo B\AppData\Local\Android\sdk. There is a whitespace character in Giacomo B.

The easiest solution is to move the SDK somewhere else, where there is no space or other whitespace character in the path, such as C:\Android\sdk. You can point both Android Studio installations to the new location.

Solution 2

There is another way:

  1. Open up CMD (as Administrator)
  2. Type: mklink /J C:\Program-Files "C:\Program Files" (Or in my case mklink /J C:\Program-Files-(x86) "C:\Program Files (x86)")
  3. Hit enter
  4. Magic happens! (Check your C drive)

Now you can point to C:\Program-Files (C:\Program-Files-(x86)).

Solution 3

just change the path:

"c:\program files\android\sdk" to "c:\progra~1\android\sdk"
or
"c:\program files (x86)\android\sdk" to "c:\progra~2\android\sdk"

note that the paths should not contain spaces.

Solution 4

It is possible to make a symbolic link from e.g. C:\Android\sdk to the actual location of the sdk (which contains whitespaces), and refer to this symbolic link from within Android Studio as the location of the SDK. I have, however, not tried whether NDK will work with such a setup, even though Android Studio stops giving this warning about whitespaces.

Solution 5

As long as you aren't using the NDK you can just ignore that warning.

By the way: This warning has nothing to do with parallel installations.

Share:
156,358
Giacomo Brunetta
Author by

Giacomo Brunetta

Updated on July 21, 2020

Comments

  • Giacomo Brunetta
    Giacomo Brunetta almost 4 years

    Recently I have installed the last version of Android Studio (Android Studio 2.1), keeping the old 1.2 version previously installed. Now i have Android Studio 2.1 and Android Studio 1.2. In Android Studio 1.2 when I click on SDK Manager it works properly, but in Andorid Studio 2.1 this problem appears: how can I fix keeping the two versions of Android studio? Thanks

  • Giacomo Brunetta
    Giacomo Brunetta about 8 years
    What can I do to fix ?
  • Bryan Herbst
    Bryan Herbst about 8 years
    It is merely a warning, not an error. If you aren't using the NDK it will be fine. It is an easy enough fix though, so I would still recommend correcting it.
  • Braian Mellor
    Braian Mellor over 7 years
    And how can you do this on mac if the default mac hard drive is called Macintosh HD?
  • Bryan Herbst
    Bryan Herbst over 7 years
  • Braian Mellor
    Braian Mellor over 7 years
    I know how to change the name, but that is not even an option for me, this is a problem for Android Studio. It will break almost every link that I have to the hard drive. Already try it and this is not a solution for me. Thanks any way
  • David Murdoch
    David Murdoch over 7 years
    This doesn't work in Android STudio 2.2.2 as it "corrects" it to the full path.
  • Erenor Paz
    Erenor Paz about 6 years
    Very useful. Does not require moving files, nor changing user's profile, nor using "old-msdos-style directory names" :-)
  • Mehdi Dehghani
    Mehdi Dehghani over 5 years
    I'm sorry but it's not easiest solution, actually it's one of hardest solutions.
  • Tagi
    Tagi about 5 years
    You save my day <3
  • Jesper Hustad
    Jesper Hustad almost 3 years
    Guess i just need to reinstall Android Studio, whish there was a faster way.