Skip to content Skip to sidebar Skip to footer

Android.bat Opens Sdk Manager, Sdk Manager.exe Does Not

I've been trying to fix this for the last 48 hours, and it is driving me insane. My SDK Manager.exe flashes a cmd screen and closes in less than a second. After much searching, I f

Solution 1:

I've experienced this on some machines, but not others. It's a strange problem and I believe it has to do with a path problem in one of the android files (android.bat?).

Why this happens on some installs and not others I have yet to figure out. I've read everything I could find both here and on the interweb, tried many different solutions, including installing another version of JDK 6 and 7, modifying the path variable, adding a JAVA_HOME variable, etc. and none worked.

This worked for me in Windows 7...

1) Add a copy of the "SDK Manager.exe" file INSIDE the SDK folder (so it's next to the tools, platforms, et. al folders) and then run it. You will still see the command window "flash" for a second and then disappear, but be patient and the SDK manager WILL show up.

2) Create a shortcut to this "inside" copy of the SDK Manager.exe and move it where ever you want; it now knows where to go to find the files and works every time. I have a copy on my desktop, but it doesn't matter where you put it.

Note: There's still a problem somewhere, and it may have to do with Google, but it seems to happen to some people regardless of what/when they do an install, while others have no issues at all.

This may not be the answer we need to get Google to fix it, but it works without uninstalling/reinstalling java or the SDK, modifying/adding variables, modifying android.bat, changing your path, running as admin, etc., and the best part is it's easy. It's too bad many of us have wasted hours of time on trying to fix it.

Good Luck!

Note: I added the comment below about x64 machines. It's strange, but when we tried it on one x64 (OS/ADT) machine and it didn't work. I just tried a fresh install of Java 7 x64, and ADT x64 on a machine where it was working with a 32bit install (meaning I now have both 32bit and 64bit installs of Java and ADT on the same machine) and again, it works fine. A brief flash, it goes away, and then the SDK manager opens as expected. The mystery continues. :)

Solution 2:

I had the same problem when I updated my android SDK tools to 23.0.2. Spent a lot of time (around 6 hours) messing around trying to find a fix... and I found it, but still not sure how it all works.

It has to do with android.bat file in the tools folder of your android SDK directory, in the lines:

set java_exe=
calllib\find_java.bat

I modified the lines into the following values:

set java_exe=pathwhereyoufindjavaexe
REM call lib\find_java.bat

Basically, two things are done:

  1. Set your java_exe variable to your Java.exe path

  2. Delete, or comment the line: "call lib\find_java.bat"

I commented second line so it DOESN'T re-set my java_exe variable through find_java.bat, and manually set my java_exe variable to where my java.exe file is. If you don't know where (or forgot where) your java.exe is, try using windows search for it.

My path for java.exe is different from the one found using find_java.bat. My Actual path:

U:\PortableApps\CommonFiles\Java\bin\Java.exe

The path find_java.bat sets it to:

C:\Windows\systems32\java.exe

NOTE: I figured what path "call lib\find_java.bat" sets the java_exe variable through adding the following command below the line itself:

echo %java_exe%
pause

I'm not sure if this is some sort of permission or access error, or this solution worked only for me since my java JDK is on USB device or such. Well, if anyone else bump into this problem, give my solution a try and see if it works for you guys as well.

Solution 3:

I had the same issue!

I had installed the ADT bundle 64-bit, so I downloaded Java 64-bit. I messed around with paths and things, but the thing that fixed it in the end was installed Java 32-bit.

The easy fix is to install both versions. You can download them manually here.

Good luck!

Solution 4:

I don't know if it will solve your problem but make sure you have installed jre and jdk and android sdk for the same bit system (I mean that all three are for 32 or 64 bit systems). I once had an android problem based on this! If you use them for one system try to reinstall them. I had a similar problem and it worked after changing all versions to 64 bit. Hope I could help you.

Solution 5:

When you 'Run as administrator' the current directory gets changed because you are impersonating another user. To prove this put the following line at the top of your bat file:

echo.CD=%CD% & pause

Then execute your bat file as a normal user and observe result.

Now execute bat file via 'Run as administrator' and note that CD has been changed to C:\Windows\system32 (typical).

The fix is simple. Put the following line in your bat file to restore the current directory:

pushd %~dp0

It needs to be before you reference any files/folders. I typically put that line near the top of all bat files that may be 'Run as administrator'. It does not hurt anything if used for older (XP) OS's.

Post a Comment for "Android.bat Opens Sdk Manager, Sdk Manager.exe Does Not"