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

13

44

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

Scathing answered 5/5, 2016 at 14:14 Comment(0)
M
49

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.

Metamorphic answered 5/5, 2016 at 14:18 Comment(7)
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.Metamorphic
And how can you do this on mac if the default mac hard drive is called Macintosh HD?Rosati
@BraianMellor: #9848195Metamorphic
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 wayRosati
I'm sorry but it's not easiest solution, actually it's one of hardest solutions.Toady
You save my day <3Vey
Guess i just need to reinstall Android Studio, whish there was a faster way.Forward
T
39

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)).

Toady answered 18/11, 2017 at 7:38 Comment(2)
Very useful. Does not require moving files, nor changing user's profile, nor using "old-msdos-style directory names" :-)Hillock
very clean,short and concisePosy
T
15

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.

Trishtrisha answered 2/10, 2016 at 11:2 Comment(1)
This doesn't work in Android STudio 2.2.2 as it "corrects" it to the full path.Aleutian
M
5

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.

Molluscoid answered 5/4, 2017 at 23:26 Comment(0)
G
4

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.

Godfrey answered 5/5, 2016 at 14:16 Comment(1)
What can I do to fix ?Scathing
F
4

Simply....If you are not using NDK, there is no problem at all. On the other this is just warning not an error. With warning you can go ahead but not errors. Any it's better to adjust the whitespaces. E.g if your SDK is at C:\program file\Android studio. There is a whitespaces "program file". There are 2 simple methods: 1. Remove the whitespaces 2. Install at another location which don't have whitespaces.

Furrier answered 7/8, 2016 at 9:2 Comment(0)
T
3

I have the same error, make some change in the path C:\Users\Juan Jose\App---- to C:\Users\JUAN~1\App.

  1. CMD Command (Windows) go to root c:\Users
  2. Type de command DIR /X Here show a Short name of Juan Jose
  3. Reemplace the name Juan Jose with the Short Name give it.
Theresiatheresina answered 16/10, 2018 at 16:25 Comment(0)
I
1

your sdk file path does not have whitespace like this./abc aaa/sdk it like ./abc_aaa/sdk this.

Investment answered 18/5, 2022 at 10:8 Comment(0)
C
0

Copy your SDK folder and paste it in another folder without spaces (for example: "D: / Android / Sdk"), then open the SDK Manager, and change the Android SDK Location to the location of your new SDK folder

Crossley answered 24/3, 2020 at 14:26 Comment(0)
T
0

Just change

C:\Users\Giacomo B\AppData\Local\Android\sdk

to

C:\Users\Giacomo_B\AppData\Local\Android\sdk

Topflight answered 21/5, 2020 at 3:14 Comment(0)
L
0

I just wanted to add a solution for Mac users since this is the top article that comes up for searches related to this issue. If you have macOS 10.13 or later you can make use of APFS Space Sharing.

  • Open Disk Utility
  • Click Partition
  • Click Add Volume -- no need to Partition as we are adding an APFS volume which shares space within the current partition/container)
  • Give the volume a name (without spaces)
  • Click Add
  • You can now mount this drive like any other via Terminal: cd /Volumes/<your_volume_name>
  • Create an empty folder in the new volume -- I called mine sdk
  • You can now select the volume and directory while installing Android Studio
Lubricous answered 20/7, 2020 at 23:53 Comment(0)
W
0

you know that this is does not do anything with your java and xml. It only affect the ndk which is for native apps or to use c++/c. so if you are just using java and xml or even kotlin there is no side effect with that thing

Wordsworth answered 10/9, 2022 at 14:18 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Kerstinkerwin
W
-2

Just remove white space of all folders present in the given path for example Program Files You can remove it by following steps-> Open elevated cmd, In the command prompt execute: mklink /J C:\Program-Files "C:\Program Files" This will remove space and replace it with "-". Better do this with both sdk and jdk path. This works :)

Witkin answered 3/7, 2018 at 13:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.