SDK Manager.exe doesn't work
Asked Answered
D

25

34

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
  3. Set environment JAVA_HOME and put %JAVA_HOME%\bin in path variable**

Actually a black cmd window appears and disappears a milliseconds.

How to fix it?

Edit:

I Googled day by day but can't find a solution for this. Even I set path for ANDROID_SWT it also can't run. I suspect that Android SDK has bug in its installation package.

I'm totally exhausted and this is the last my try:

  1. Uninstall JDK, Android SDK, remove all ANDROID or JAVA environment variables
  2. reinstall JDK and Android SDK

But nothing changes.

Edit:

Actually this is the second time I meet this problem. I got this problem only after I added more Environment variables for Ant and Maven. This is the summary:

Install Windows XP SP3 --> Install JDK --> Install Android SDK --> Open SDK Manager and it works! --> append some more "bin" path of Ant and Maven in "path" variable --> Open SDK Manager and it doesn't open --> I rolled back by removing all environment variables --> SDK Manager still no opens! That's very strange! --> It is stranger when I reinstall JDK and Android SDK, it still no opens! :(

Dosage answered 4/6, 2011 at 2:53 Comment(0)
T
50

Step #1: Open up a command prompt.

Step #2: Use the cd command to move to wherever you installed your Android SDK.

Step #3: Run tools\android.

If that does not work, you should have information dumped to the command prompt that will help you diagnose your setup problem.

Tantalic answered 4/6, 2011 at 11:17 Comment(4)
It reports: "Unable to access jarfile lib\archquery.jar [INFO] Starting Android SDK and AVD Manager Invalid path ERROR: SWT folder '' does not exist. Please set ANDROID_SWT to point to the folder containing swt.jar for your platfo rm."Dosage
Hey ...I was facing the same problem .. this solution worked for me .. after running the Android command, it successfully opened SDK Manager and works fine.Thanks.Terti
Me too.. Thanks a lot for the tip.. still wondering why it didnt open when running as administratorLimiter
Worked for me, but I did need to run the command prompt as "administrator" else you get an "permission denied" and then "nothing to install"Revell
M
13

I was getting the error "C:\Program is not recognized as an internal or external command" Followed by loads of "unable to copy file" Followed by something about Android_SWT not being able to be found.

The way I fixed the problem on my system (Windows 8, 64 bit, JDK 7) was:

  1. Create JAVA_HOME environment variable and point it to C:\Program Files\Java\jdk1.7.0_10\bin
  2. Open ANDROID SDK DIRECTORY\tools\android.bat in your favorite text editor
  3. Find the lines set java_exe= call lib\find_java.bat (it's split over 2 lines)
  4. Replace the lines with set java_exe="%JAVA_HOME%\java.exe"
  5. Save and run tools\android.bat

The problem was that the the space in the path was not being handled correctly. By wrapping the path in quotation marks, the space is then correctly catered for.

Marylandmarylee answered 10/1, 2013 at 23:27 Comment(2)
Didn't work for me - the same message '""c:\Program' is not recognized as an internal or external command, operable program or batch file.Mcbryde
@Mcbryde if this is still a problem, surround the full path in double quotesTrinidadtrinitarian
S
10

I had the same problem.

when i run \tools\android.bat, i got the exception: Exception in thread main

 java.lang.NoClassDefFoundError: com/android/sdkmanager/Main

My resolved method:

  1. edit \tools\android.bat
  2. find "%jar_path%;%swt_path%\swt.jar"
  3. modify to "%tools_dir%\%jar_path%;%tools_dir%\%swt_path%\swt.jar"
  4. save, and run SDK Manager.exe again
Simian answered 27/9, 2011 at 10:2 Comment(2)
Doing this made something happen when run from the command line. It starts downloading a bunch of xml files and other files. When it's running the :MkTempCopy section it sets tools_dir to the current directory. There appears to be a bug in this section.Bibliofilm
My issue was solved by removing a ambersand in the path of the adt bundle.Elide
C
7

After a lot of searching and trying different methods, I found the solution to the problem at my end: SDK Manager couldn't find my profile directory. After setting the environment variable ANDROID_SDK_HOME (I set mine to a newly created folder C:\Android), SDK manager started no prob.

Cotenant answered 18/7, 2011 at 9:12 Comment(2)
Can you clarify on this answer? Where is Android_SDK_Home even being referenced? In what files? What do I put in the C:\Android folder?Danette
@Lars - I was not aware Android used ANDROID_SDK_HOME. Where did you latch onto ANDROID_SDK_HOME? I know it 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?. The fellow named Digit works on the NDK team.Displayed
E
5

I have Wondows 7 64 bit (MacBook Pro), installed both Java JDK x86 and x64 with JAVA_HOME pointing at x32 during installation of Android SDK, later after installation JAVA_HOME pointing at x64.

My problem was that Android SDK manager didn't launch, cmd window just flashes for a second and that's it. Like many others looked around and tried many suggestions with no juice!

My solution was in adding bin the JAVA_HOME path:

C:\Program Files\Java\jdk1.7.0_09\bin

instead of what I entered for the start:

C:\Program Files\Java\jdk1.7.0_09

Hope this helps others.... good luck!

Effeminate answered 25/11, 2012 at 14:42 Comment(0)
A
2

My issue was the following error on windows 7:

C:\dev\Android\android-sdk-windows\tools>android
[INFO] Starting Android SDK and AVD Manager
No command line parameters provided, launching UI.
See 'android --help' for operations from the command line.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3550 or
swt-win32 in swt.library.path, java.library.path or the jar file
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
        at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
        at com.android.sdkmanager.Main.showMainWindow(Main.java:292)
        at com.android.sdkmanager.Main.doAction(Main.java:276)
        at com.android.sdkmanager.Main.run(Main.java:99)
    at com.android.sdkmanager.Main.main(Main.java:88)

The solution was to disable McAfee 8.8. Apparently some recent update is now blocking my Android environment.

Attic answered 5/10, 2011 at 0:41 Comment(1)
This is a workaround only. Disabling antivirus permanently to solve an install problem is bad practice. Was AV disabled just during install or turned off for good?Hibbler
R
2

The way I solved your last problem was by right clicking the android.bat file, and chose edit with notepad++. I then went down to the part of the program where it had this bit of code:

cd /d %~dp0

It was also some other lines of code, but I deleted them. After deleting these other lines I simply just wrote(under the cd /d %~dp0):

cd Program Files

cd java

cd jdk1.7.0_03

cd bin

I dont know here you java.exe file is located but mine was at lest located there.

Roundworm answered 12/4, 2012 at 17:9 Comment(0)
T
2

Similar to sixty9 I renamed java.exe, javaw.exe, javaws.exe (I never delete files when troubleshooting) after I created a JAVA_HOME environment variable and added path variables.

I had installed the Java SDK on my D:\ drive ( instead of the default).

  1. Create a JAVA_HOME variable: Variable Name: %JAVA_HOME% Value: D:\Program Files\Java.

  2. Added the following to the Path variable:

    %JAVA_HOME%\jre7\bin;%JAVA_HOME%\jdk1.7.0_03\bin;
    
  3. Renamed java.exe, javaw.exe and javaws.exe.

  4. Restarted the system and the Android SDK installer found my JDK and installed successfully.

Topography answered 15/4, 2012 at 13:57 Comment(0)
P
2

I ran into this problem: I'd get the error

C:\projects\Android\android-sdk-windows-1.5_r1\tools\lib>ddms
02:03:07 E/ddms: shutting down due to uncaught exception
02:03:07 E/ddms: no swt-win32-3550 or swt-win32 in swt.library.path, java.library.path or the jar file
java.lang.UnsatisfiedLinkError: no swt-win32-3550 or swt-win32 in swt.library.path, java.library.path or the j
ar file
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
        at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
        at org.eclipse.swt.graphics.FontData.<init>(Unknown Source)
        at com.android.ddms.PrefsDialog.setDefaults(PrefsDialog.java:221)
        at com.android.ddms.PrefsDialog.init(PrefsDialog.java:150)
        at com.android.ddms.Main.main(Main.java:74)

I got this solved by copying the swt file from eclipse into the tools directory. If you search in the directory you have Eclipse installed there is an SWT dll, named something like swt-win32-<4-digits>.dll (mine was named swt-win32-3740.dll): I copied that into the tools directory, and everything worked after that.

Perrins answered 4/12, 2012 at 19:8 Comment(1)
Your later answer at https://mcmap.net/q/121418/-how-to-run-quot-android-bat-sdk-quot-in-windows-7 is simpler. And it worked for me, so thank you very much :-)Subway
S
2

I solved my problem opening android.bat inside sdk/tools and setting the java_exe property, which was empty.

set java_exe="C:\Program Files\Java\jre6\bin\java"
Seedy answered 28/2, 2013 at 13:31 Comment(0)
C
1

I add new environment variable "ANDROID_SDK_HOME" and set it, like my path to android SDK folder (c:/Android) and it's work!

Cannice answered 18/8, 2011 at 18:54 Comment(0)
V
1

And if tools\android works for you while .exe doesn't, it's probably the x64 java.

It started working when i completely uninstalled JDK with JRE (shows as separate option in windows uninstal control panel applet) and android sdk and reinstalled using x86 version.

Why does it worth the time, you may ask? Well, such an inconsistency obvoiusly means that amount of testing with x64 java is zero and so you can probably experience many other failures in the future.

Varick answered 10/1, 2012 at 21:41 Comment(0)
T
1

Finally got this torterous SDK to run.

When installing 32bit Java on 64bit windows system, set ANDROID_SWT to e:\android-sdk\tools\lib\x86

not ..\x86_64

Dear Android SDK team,

I genuinely hope some serious attention is being paid to these problems. SDK should be effortless to set up. This is how you lose customers to other platforms where this kind of thing is a one-click ordeal.

I was going to buy another android device to test my game on, but after last 2 days trying to traverse the maze of your incompetence I think i'll just stick with iOS as my main development target.

Tack answered 6/4, 2012 at 18:53 Comment(1)
I understand your sentiment so much right now. I'm on over 10 hours of trying to get this sht to work...it's amazing that this one problem has a million different solutions and everyone's solution is different and yet I still can't find a solution.Danette
M
1

I solved this problem, which occured for me after manually installing the ADT (4.2/api 17) bundle on Windows 7 64 bit in C:\Program Files.

The steps I had to take:

  1. Set the JAVA_HOME environment variable to the installation directory of the (64 bit) JDK, C:\Program Files\Java\jdk1.7.0_11 in my case.
  2. Run SDK Manager as administrator at least once. SDK Manager allows you to change files in Program Files, so you should give it the proper access rights.
Mckinzie answered 21/1, 2013 at 12:28 Comment(0)
R
1

None of the Solution worked for me

Just open sdk/tools/

Edit android.bat

Replace set java_exe="C:\Program Files\Java\jdk1.7.0_13\bin\java.exe" //your java path

Copy the sdk manager and avd from any tools/lib if its not in sdk/ base folder

Reify answered 2/2, 2014 at 8:57 Comment(0)
L
1

I FINALLY GOT THIS WORKING AFTER 2 SOUL DESTROYING EVENINGS OF TRYING! IF I EVER MEET AN ANDROID SDK DEVELOPER I WILL HACK HIM TO DEATH WITH HIS OWN KEYBOARD

Anyway, tips for getting it working on Windows 7 64 bit...

I suspect for me it was multiple problems as none of the suggestions worked so I will list all the things I did to finally get it working

1) Install the 32 BIT version of Java JDK (yes, even if you are running 64bit Windows)

2) Install both the SDK and the JDK to paths that have no spaces in (I used C:\Android and C:\Java32)

3) In the Windows environment variables screen (System Properties > Advanced Settings > Env vars), there's two places you can enter the variables, the "User Variables" and "System variables". I put them in both and included the "bin" bit in both e.g.

JAVA_HOME = C:\Java32\jdk1.8.0_20\bin

Path = C:\Java32\jdk1.8.0_20\bin;other paths should come AFTER the jdk...

4) Edit the file tools\android.bat and look for the following:

set java_exe=

call lib\find_java.bat

change this to:

set java_exe="C:\Java32\jdk1.8.0_20\bin\java.exe"

rem call lib\find_java.bat

You can also put the "@echo off" to "@echo on" at the top of the file for debugging purposes

Good luck!

Lycurgus answered 1/10, 2014 at 20:4 Comment(0)
I
0

Had the same problem and tried everything I browse in several forums till I found a clue, then finally solved the problem.

Basically I installed the SDK and worked ok, then my Windows Vista crashed, on restart I run SDK again but it only opened a CMD window which closed immediately.

So here's a list of useless things I did:

  • Went to CMD "d:/java/android/tool" and execute "android.bat", didn't work and show an pointer exception error.
  • Reinstalled the whole thing JDK + SDK
  • Changed the system path to a new folder
  • I traced and deleted all android occurrences on Regedit

At this point I was seriously considering start learning objetive-c was not a bad idea, finally I did this:

  • delete ".android" folder from "c:/users/youruser/"
  • delete all files within "c:/users/youruser/AppData/Local/Temp"
  • reinstall SDK

it WORKED !! I'm not sure though if is necessary to uninstall SDK (since I had again to download all packages & platforms) and just clear the temp folder.

Hope this helps.

Ishii answered 25/6, 2011 at 4:10 Comment(1)
I swear I did everything you said. Remove .android folder, files in Temp, all android environment vars; using CCleaner to clean everything; restart Windows; reinstall SDK. It still doesn't work.Dosage
F
0

I had the same problem, running X64 Java (1.7.0_03-b05). Even though I had both C:\Program Files\Java\jre7\bin and C:\Program Files\Java\jdk1.7.0_03\bin listed in my path, it wouldn't start - just flashed a command prompt.

The tools\lib\find_java.bat file was reporting that it was attempting to run C:\Windows\system32\java.exe but failed. Huh? I checked, and found outdated copies of java.exe, javaw.exe and javaws.exe in my C:\Windows\system32. How did those get there, I didn't put them there!

I deleted those three files from C:\Windows\system32 and the problem was fixed.

Thinking about it, the problem likely would have been fixed by making sure thatC:\Program Files\Java\jre7\bin and C:\Program Files\Java\jdk1.7.0_03\bin were at the START of my PATH variable instead of tacked onto the end.

Frankiefrankincense answered 28/3, 2012 at 19:14 Comment(0)
B
0

I had this same problem and after trying a variety of things like changing the path variables I went to java.com on a whim and downloaded java, installed, and lo and behold the sdk manager worked after that.

Batish answered 5/4, 2012 at 21:21 Comment(0)
C
0

I fixed this issue by reinstalling it in Program Files, it originally tried to install it in c:/Users/.../AppData/Android/....

Mine was caused by a user permission issue that running as admin didn't seem to fix (perhaps because they call batch files?).

Cacodyl answered 16/10, 2012 at 11:44 Comment(0)
S
0

What I did was:

set a new environment variable in the top user section.

VARIABLE NAME: JAVA_HOME VARIABLE VALUE: set it to the installation directory of your most recent JDK.

For me it was, C:\Program Files\Java\jdk1.7.0_13 . Run SDK Manager as administrator at least once. I use windows 7. This method worked for me after a lot of research.

What I dont understand is when using 'where java' in the command prompt it still references C:\Windows\System32\java.exe. My SDK Manager now opens when I need it so I solved my problem.

Sprouse answered 18/2, 2013 at 21:57 Comment(0)
L
0

I was experiencing the UnsatisfiedLinkError on Windows 7 64-bit after installing adt-bundle-windows-x86_64-20130717.zip:

 Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3550 or swt-win32 in swt.library.path, java.library.path or the jar file

The root cause was that McAfee has a feature that blocks loading DLL's from the temporary directory. This is a problem because android.bat copies a bunch of JAR and DLL files to a temporary directory and runs the program from there, to make it easy to upgrade the app in-place.

This feature can be disabled, however. You can either disable "Access Protection" altogether or only disable the feature that blocks loading DLLs from temporary folders.

Screenshot showing the McAfee UI where access protection can be disabled Screenshot showing the McAfee UI where you can disable the feature where it blocks loading DLLs from the temp directory

Later answered 21/7, 2013 at 14:11 Comment(0)
H
0

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 installing Java 32-bit.

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

Good luck!

Hunchback answered 21/1, 2014 at 13:48 Comment(0)
D
0

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
Displayed answered 27/12, 2014 at 3:52 Comment(0)
A
0

find_java.exe doesn't seem to like the openjdk "java -version" output. I edited find_java.bat like this:

for /f %%a in ('%~dps0\find_java.exe -s') do set java_exe=%%a
set java_exe="C:\Program Files (x86)\AdoptOpenJDK\jdk-8.0.242.08-hotspot\bin\java.exe"

rem ...

for /f %%a in ('%~dps0\find_java.exe -s -w') do set javaw_exe=%%a
set javaw_exe="C:\Program Files (x86)\AdoptOpenJDK\jdk-8.0.242.08-hotspot\bin\javaw.exe"
Astrosphere answered 4/3, 2020 at 18:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.