Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android SDK manager won't open

Tags:

android

path

People also ask

How do I open SDK Manager?

To open the SDK Manager from Android Studio, click Tools > SDK Manager or click SDK Manager in the toolbar. If you're not using Android Studio, you can download tools using the sdkmanager command-line tool. When an update is available for a package you already have, a dash appears in the check box next to the package.

What is Sdkmanager bat?

The sdkmanager is a command line tool that allows you to view, install, update, and uninstall packages for the Android SDK. If you're using Android Studio, then you do not need to use this tool and you can instead manage your SDK packages from the IDE.


Make sure your java\bin directory is in your path statement before the windows\system32 directory. The SDK Manager uses java and it was finding the one in the system32 folder.

In a CMD window, you can run 'where java'. Don't forget to restart your CMD after changing the path variable for checking.


Alright, I had the same problem, and none of these answers worked for me (I'm running Windows 8). I tried running tools/android.bat and noticed I got some errors there. I investigated further and it seems there is something wrong in the code that finds your Java path.

This is how you fix it:

  1. Open up tools/android.bat in your favorite text editor
  2. Search for this piece of code:

    set java_exe=
    call lib\find_java.bat
    if not defined java_exe goto :EOF
    
  3. Replace it with this:

    set java_exe=D:\Program Files\Java\jdk1.7.0_07\bin\java.exe 
    

    where the path is the path to your Java exe.

  4. Run android.bat

(in my case I had to specify the path to java_exe in step 3 with no quotes to make it work.)


There are many reasons as to why the SDK Manager won't open. Rather than trying each one of them blindly, I recommend running the android.bat in a command window so you can read the error message and apply the correct fix.


In the latest version of the Android SDK, running "SDK Manager.exe" and/or "AVD Manager.exe" will not open anymore. Even the "Launch Standalone SDK Manager" link in Android Studio, which can be previously found in Android SDK Settings, is now gone.

It is now recommended to perform manual SDK and AVD management inside Android Studio. But for those who do not have an Android Studio or for those who do not like to open Android Studio just to perform SDK management, you can still manage the SDK using the command line tools, "tools/bin/sdkmanager.bat" and "tools/bin/avdmanager.bat".

This information is available when running "tools/android.bat". I think this is true for those who currently have Android SDK tooks v25.3.1 and above.


Same problem here. Fixed! I installed the correct Java stuff, all for 64 bit, because my system is x64, and nothing happened. So I went to C:\Users\[my name] and deleted the directory .android that has been created the first time the SDK ran, apparently with some wrong configuration.

Then it worked. You can try that. Delete that folder or just move it to the desktop and run the SDK.


Google removed the GUI for SDK starting from version 26. If you're using version 26, try downgrading to version 25. You can still open the SDK from Android Studio.

Source: Is GUI for Android SDK manager gone?


There appear to be several ways to launch the SDK Manager:

  1. SDK Manager.exe in the root of the Android SDK.
  2. SDK Manager.exe in sdk\tools\lib of the Android SDK.
  3. Window -> Android SDK Manager menu in Eclipse
  4. android.bat in sdk\tools of the Android SDK.

In my case, it looks like android.bat fails on the line:

for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a

As far as what that line is doing... if I manually run: "[path_to_java]java" -jar lib\archquery.jar

It successfully returns: x86_64

But when the batch file runs that same command, I don't know why but it fails with the error message:

Unable to access jarfile lib\archquery.jar

So the variable swt_path gets set to an empty string. Everything breaks down from there.

The batch file sets the correct value for the variable java_exe. Others have commonly reported this as a problem, but those workarounds weren't relevant in my case.

People have recommended commenting out the problem line by adding REM to the beginning of it, and adding a line to manually set the swt_path variable, which is a valid workaround:

REM for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
set swt_path=lib\x86

BUT, the critical issue in my case is that it's choosing to load a jar file from either the lib\x86 or the lib\x86_64 folder here. At some point, things were getting confused between the BAT file error, a 32-bit JDK, and a 64-bit Android SDK.

SO, the workaround in my case was to:

  1. Uninstall ALL versions of Java
  2. Install the JDK
    • You can either use the 32-bit Android SDK and install the 32-bit JDK
    • Or use the 64-bit Android SDK and install the 64-bit JDK
    • But the "bitness" of the JDK should match the Android SDK. It appears that either of the 32-bit or the 64-bit will work on a 64-bit computer, AS LONG AS the JDK bitness matches the Android SDK bitness.
  3. Edit "android.bat"

    • If using the 32-bit Android SDK/JDK, use lib\x86:

      REM for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
      set swt_path=lib\x86
      
    • If using the 64-bit Android SDK/JDK, use lib\x86_64:

      REM for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
      set swt_path=lib\x86_64
      

After doing this, I can successfully run the SDK Manager by running android.bat, or from the Eclipse menu (but still not by running either of the SDK Manager.exe files directly).