SDK Manager.exe doesn't work

前端 未结 25 1251
青春惊慌失措
青春惊慌失措 2020-11-27 14:28

When I clicked SDK Manager on Program Files or run it in cmd, nothing happened. I did:

  1. Installed latest JDK
  2. Installed latest Android SDK<
25条回答
  •  感情败类
    2020-11-27 15:00

    When I clicked SDK Manager on Program Files or run it in cmd, nothing happened

    One of your problems is Long File Names in Windows. A number of the Android tools cannot handle them. I filed a bug report on them years ago, but I can't find it at the moment. I also seem to recall something about it in the INSTALL or README.

    So you should install the tools in a location without spaces. Use something like C:\Android\ or C:\Android-SDK\.

    @Steve and @MeatPopsicle already mentioned spaces in the pathames, but it can't be overstated.


    Actually a black cmd window appears and disappears a milliseconds.
    ... Even I set path for ANDROID_SWT

    Out of curiosity, where did ANDROID_SWT come from?

    I know Android does use ANDROID_HOME, ANDROID_SDK_ROOT and ANDROID_NDK_ROOT, and the last two should both be set because the tools use them internally. Here's the reference on ANDROID_SDK_ROOT and ANDROID_NDK_ROOT: Recommended NDK Directory?.

    So you should set the three environmental variables (after ensuring the installation directory does not contain spaces):

    • ANDROID_HOME
    • ANDROID_SDK_ROOT
    • ANDROID_NDK_ROOT

    ANDROID_HOME is set to the directory where the hidden directory .android is.

    ANDROID_SDK_ROOT is set to the directory where the SDK is installed, like C:\Android-SDK\.

    ANDROID_NDK_ROOT is set to the directory where the NDK is installed, like C:\Android-NDK\. If its not installed, then don't set it.


    Once you have ANDROID_SDK_ROOT set, you can put %ANDROID_SDK_ROOT%\tools and %ANDROID_SDK_ROOT%\platform-tools on PATH. Then, you can drop into a command line and issue something like this (and it just works):

    adb list
    

提交回复
热议问题