Changing SDK location in Android Studio:Whitespaces in directory location

感情迁移 提交于 2019-12-21 20:47:16

问题


I am using android API level 22.But this location was copied from another machine and it is in my E: drive.I have API level 23 installed in the following location:

C:\Program Files (x86)\Android\android-sdk

But when i try to change the location to the above one, i get the following message:

Android SDK location should not contain whitespace,as this can cause problem with the native tools.

How do i change the SDK location to the above location without having the issue of whitespaces.


回答1:


Change location to (in my case its located here)

C:\Users\johnrao\AppData\Local\Android\Sdk

Try Copying files in these folders or delete files and reinstall from the sdk manager




回答2:


Here is how I fixed this issue. No need to relocate directories.

On Windows, open an elevated command prompt. Hit the Win key, type 'cmd', right click on the cmd prompt search entry, select 'Run as Administrator".

In the command prompt, execute: mklink /J C:\Program-Files "C:\Program Files"

This will create a space-free directory path that points into the same directory as used by space-friendly software.




回答3:


If it is located in your home directory, as it seems to be by default, you can open up a Command Prompt to see what the "DOS" version of your home directory looks like:

dir /x C:\Users

Look at the 4th column, and it should show the valid 8-character (max) directory name that can be used in the Android Studio path.



来源:https://stackoverflow.com/questions/34127431/changing-sdk-location-in-android-studiowhitespaces-in-directory-location

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!