• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

android sdk location should not contain whitespaces

werner111

Lurker
Nov 11, 2021
7
1
Hi,

For my unity project I need a higher sdk. When I want to change it in android studio (settings -> andriod SDK) I get the message:
"android sdk location should not contain whitespaces"

The location is: "Program files" with whitespaces
C:\Program Files\Unity\Hub\Editor\2021.3.24f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK

What I try:
- I can't rename the map because it cause a lot of issues
- I fill: c:\progra~1\Unity\Hub\Editor\2021.3.24f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK
but it doesn't work, I cant select this directory

In android studio I have android api 33 at the directory:
C:\Users\werne\AppData\Local\Android\Sdk
It doesn't work when I fill this location in Unity.

Anyone a idea?
 
One solution could be to create a symbolic link for the Android SDK directory. This will create a shortcut to the actual directory without any whitespaces in the path. Here are the steps to create a symbolic link: 1. Open a command prompt in administrator mode 2. Navigate to the directory where you want to create the symbolic link (e.g. C:\Program Files\Unity\Hub\Editor\2021.3.24f1\Editor\Data\PlaybackEngines\AndroidPlayer) 3. Type the command: mklink /D AndroidSDK "C:\Program Files\Unity\Hub\Editor\2021.3.24f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK" 4. This will create a symbolic link named "AndroidSDK" that points to the actual Android SDK directory without any whitespaces in the path 5. Now you can use the location "C:\Program Files\Unity\Hub\Editor\2021.3.24f1\Editor\Data\PlaybackEngines\AndroidPlayer\AndroidSDK" in Unity to select the Android SDK directory. Note: Make sure to replace the actual path of the Android SDK directory in step 3 with the correct path on your system.
Thanks you for your steps, I try it but it didn't work.

1. Do I need to use in step 3 this path:
C:\Program Files\Unity\Hub\Editor\2021.3.24f1\Editor\Data\PlaybackEngines\AndroidPlayer
or
C:\Program Files\Unity\Hub\Editor\2021.3.24f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK
Because I want to change the SDK

2. Do I need to type this without whitespraces in "Program files" in step 3?
Type the command: mklink /D AndroidSDK "C:\Program Files\Unity\Hub\Editor\2021.3.24f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK"
Like this:
C:\ProgramFiles\Unity\Hub\Editor\2021.3.24f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones