简体   繁体   English

Android SDK 管理器打不开

[英]Android SDK manager won't open

So I installed the android sdk for Windows:所以我为 Windows 安装了 android sdk:

http://developer.android.com/sdk/index.html (the installation link) http://developer.android.com/sdk/index.html (安装链接)

And ran into the path variable problem.并遇到了路径变量问题。 So I fixed that by changing "PATH" in enviroment variables to include where my java.exe file is located from the JDK.所以我通过更改环境变量中的“PATH”来解决这个问题,以包含我的 java.exe 文件在 JDK 中的位置。

But now when I open the android sdk manager, a cmd-like screen just briefly flashes on for half a second then disappears.但是现在当我打开 android sdk 管理器时,一个类似 cmd 的屏幕只是短暂地闪烁了半秒钟然后消失了。 I have no idea what's going on and how to get this thing working.我不知道发生了什么以及如何让这件事发挥作用。

Make sure your java\\bin directory is in your path statement before the windows\\system32 directory.确保您的java\\bin目录在windows\\system32目录之前的路径语句中。 The SDK Manager uses java and it was finding the one in the system32 folder. SDK 管理器使用 java,它在 system32 文件夹中找到了那个。

In a CMD window, you can run ' where java '.在 CMD 窗口中,您可以运行“ where java ”。 Don't forget to restart your CMD after changing the path variable for checking.更改路径变量后不要忘记重新启动 CMD 进行检查。

Alright, I had the same problem, and none of these answers worked for me (I'm running Windows 8).好吧,我遇到了同样的问题,这些答案都不适合我(我正在运行 Windows 8)。 I tried running tools/android.bat and noticed I got some errors there.我尝试运行tools/android.bat并注意到我在那里遇到了一些错误。 I investigated further and it seems there is something wrong in the code that finds your Java path.我进一步调查,发现您的 Java 路径的代码似乎有问题。

This is how you fix it:这是你修复它的方法:

  1. Open up tools/android.bat in your favorite text editor在你最喜欢的文本编辑器中打开tools/android.bat
  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.其中 path 是您的 Java exe 的路径。

  4. Run android.bat运行android.bat

(in my case I had to specify the path to java_exe in step 3 with no quotes to make it work.) (在我的情况下,我必须在步骤 3 中指定java_exe的路径,不带引号才能使其工作。)

There are many reasons as to why the SDK Manager won't open. SDK 管理器打不开的原因有很多。 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.与其盲目地尝试每一个,我建议在命令窗口中运行 android.bat,以便您可以阅读错误消息并应用正确的修复程序。

In the latest version of the Android SDK, running "SDK Manager.exe" and/or "AVD Manager.exe" will not open anymore.在最新版本的 Android SDK 中,运行“SDK Manager.exe”和/或“AVD Manager.exe”将不再打开。 Even the "Launch Standalone SDK Manager" link in Android Studio, which can be previously found in Android SDK Settings, is now gone.甚至之前可以在 Android SDK 设置中找到的 Android Studio 中的“启动独立 SDK 管理器”链接现在也不见了。

It is now recommended to perform manual SDK and AVD management inside Android Studio.现在建议在 Android Studio 中执行手动 SDK 和 AVD 管理。 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" .但是对于那些没有Android Studio或者不喜欢打开Android Studio只是为了进行SDK管理的人,仍然可以使用命令行工具“tools/bin/sdkmanager.bat”“工具/bin/avdmanager.bat”

This information is available when running "tools/android.bat".此信息在运行“tools/android.bat”时可用。 I think this is true for those who currently have Android SDK tooks v25.3.1 and above.我认为对于那些目前拥有 Android SDK 版本 v25.3.1 及更高版本的人来说,这是正确的。

Same problem here.同样的问题在这里。 Fixed!固定的! I installed the correct Java stuff, all for 64 bit, because my system is x64, and nothing happened.我安装了正确的 Java 东西,都是 64 位的,因为我的系统是 x64,什么也没发生。 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.所以我去了C:\\Users\\[my name]并删除了第一次运行 SDK 时创建的目录.android ,显然配置有误。

Then it worked.然后它起作用了。 You can try that.你可以试试。 Delete that folder or just move it to the desktop and run the SDK.删除该文件夹或将其移动到桌面并运行 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. Google 从 26 版开始删除了 SDK 的 GUI。如果您使用的是 26 版,请尝试降级到 25 版。您仍然可以从 Android Studio 打开 SDK。

Source: Is GUI for Android SDK manager gone?来源: Android SDK 管理器的 GUI 消失了吗?

There appear to be several ways to launch the SDK Manager:似乎有几种方法可以启动 SDK Manager:

  1. SDK Manager.exe in the root of the Android SDK. Android SDK 根目录中的SDK Manager.exe
  2. SDK Manager.exe in sdk\\tools\\lib of the Android SDK. Android SDK 的sdk\\tools\\lib中的SDK Manager.exe
  3. Window -> Android SDK Manager menu in Eclipse Eclipse 中的Window -> Android SDK Manager菜单
  4. android.bat in sdk\\tools of the Android SDK. Android SDK 的sdk\\tools中的android.bat

In my case, it looks like android.bat fails on the line:就我而言,看起来android.bat失败了:

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至于那条线在做什么......如果我手动运行: "[path_to_java]java" -jar lib\\archquery.jar

It successfully returns: x86_64它成功返回: 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.因此变量swt_path被设置为空字符串。 Everything breaks down from there.一切都从那里崩溃了。

The batch file sets the correct value for the variable java_exe .批处理文件为变量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 来注释掉问题行,并添加一行来手动设置swt_path变量,这是一种有效的解决方法:

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.但是,就我而言,关键问题是它选择从lib\\x86lib\\x86_64文件夹中加载 jar 文件。 At some point, things were getting confused between the BAT file error, a 32-bit JDK, and a 64-bit Android SDK.在某些时候,BAT 文件错误、32 位 JDK 和 64 位 Android SDK 之间的事情变得混乱。

SO , the workaround in my case was to:所以,在我的情况下的解决方法是:

  1. Uninstall ALL versions of Java卸载所有版本的 Java
  2. Install the JDK安装 JDK
    • You can either use the 32-bit Android SDK and install the 32-bit JDK您可以使用 32 位 Android SDK 并安装 32 位 JDK
    • Or use the 64-bit Android SDK and install the 64-bit JDK或者使用64位Android SDK并安装64位JDK
    • But the "bitness" of the JDK should match the Android SDK.但是JDK的“位数”应该与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.似乎 32 位或 64 位都可以在 64 位计算机上运行,​​只要 JDK 位数与 Android SDK 位数匹配。
  3. Edit "android.bat"编辑“android.bat”

    • If using the 32-bit Android SDK/JDK, use lib\\x86 :如果使用 32 位 Android SDK/JDK,请使用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 :如果使用 64 位 Android SDK/JDK,请使用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).执行此操作后,我可以通过运行android.bat或从 Eclipse 菜单成功运行 SDK Manager(但仍然不能通过直接运行任一SDK Manager.exe文件)。

The simplest way is to run the program as administartor.最简单的方法是以管理员身份运行程序。

Right-click the SDK Manager -> Run as Administrator右键单击SDK Manager ->以管理员身份运行

That should solve the problem :)那应该可以解决问题:)

I had the same problem, tried setting path variables and everything.我遇到了同样的问题,尝试设置路径变量和所有内容。 What SDK manager needs is not the JDK, but the actual Java SE end user crap. SDK 管理器需要的不是 JDK,而是实际的 Java SE 最终用户废话。 Go to http://www.java.com/en/download/ie_manual.jsp?locale=en and download that.转到http://www.java.com/en/download/ie_manual.jsp?locale=en并下载它。 As soon as I finished installing that, it worked like a charm一旦我完成安装,它就像一个魅力

Try adding the Java path (pointing to the JDK) to the System Environment Variables.尝试将 Java 路径(指向 JDK)添加到系统环境变量。

Right-click 'Computer' > Properties > Advanced system settings > Environment Variables右键单击“计算机”> 属性> 高级系统设置> 环境变量

Then under System Variables, add a new variable.然后在系统变量下,添加一个新变量。

Variable   Value
JAVA_PATH  C:\Program Files\Java\jdk1.7.0

Then edit the Path variable, prefix it with %JAVA_PATH%\\bin;然后编辑Path变量,以%JAVA_PATH%\\bin;前缀%JAVA_PATH%\\bin; . .

Locating the android.bat file in the tools folder worked for me.在工具文件夹中找到 android.bat 文件对我有用。 Funny that it is such a chore to get it to run.有趣的是让它运行是一件很麻烦的事。 In my experience, usually .exe files run as expected.根据我的经验,通常 .exe 文件会按预期运行。 I'm not sure why it doesn't in this case... strange and annoying!我不知道为什么在这种情况下它不会......奇怪而烦人!

I had something totally different than the other answers.我有一些与其他答案完全不同的东西。

I ran tools/android.bat and got我运行了tools/android.bat并得到了

java.lang.NullPointerException
        at java.io.File.<init>(File.java:251)
        at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1623)
        at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1584)
        at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:357)
        at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:380)
        at com.android.sdklib.internal.repository.updater.UpdaterData.initSdk(UpdaterData.java:259)
        at com.android.sdklib.internal.repository.updater.UpdaterData.<init>(UpdaterData.java:127)
        at com.android.sdkuilib.internal.repository.SwtUpdaterData.<init>(SwtUpdaterData.java:61)
        at com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2.<init>(SdkUpdaterWindowImpl2.java:104)
        at com.android.sdkuilib.repository.SdkUpdaterWindow.<init>(SdkUpdaterWindow.java:88)
        at com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:408)
        at com.android.sdkmanager.Main.doAction(Main.java:391)
        at com.android.sdkmanager.Main.run(Main.java:151)
        at com.android.sdkmanager.Main.main(Main.java:117)

Basically it looked like I had a corrupt AVD configuration, so I went and cleared out my virtual devices and everything started working again!基本上看起来我的 AVD 配置损坏了,所以我去清理了我的虚拟设备,一切又开始工作了! (Files in C:\\Users\\YourUser\\.android\\avd for windows users) (Windows 用户在C:\\Users\\YourUser\\.android\\avd中的文件)

I faced the same issue and finally managed to solve it.我遇到了同样的问题,并最终设法解决了它。 I then created a step-by-step guide containing the universal fix to help all developers get past this issue asap: http://www.dominantwire.com/2015/03/android-sdk-not-opening.html然后我创建了一个包含通用修复程序的分步指南,以帮助所有开发人员尽快解决这个问题: http : //www.dominantwire.com/2015/03/android-sdk-not-opening.html

All the steps in short:简而言之,所有步骤:

1.If you have jdk v1.8. 1.如果你有jdk v1.8。 Remove it and re-install jdk v1.7.xx删除它并重新安装jdk v1.7.xx

2.Set paths to jdk and jre bin folders in the environment variables 2.在环境变量中设置jdk和jre bin文件夹的路径

3.delete (make a backup first) the .android folder present in C: > Users > [user-name] > .android 3.删除(先备份)C中的.android文件夹:>用户>[用户名]>.android

4.Set the JAVA_HOME variable keeping JAVA_HOME as the variable name and the path to bin folder of jdk as the variable value. 4.设置JAVA_HOME变量,变量名以JAVA_HOME为变量名,变量值为jdk的bin文件夹路径。

5.Go to [sdk-directory] > tools. 5.转到[sdk-目录]>工具。 Find and right-click on android.bat file and select 'edit' to open it in notepad and make the following modifications.找到并右键单击 android.bat 文件,然后选择“编辑”在记事本中打开它并进行以下修改。

ORIGINAL原来的

set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF

MODIFIED修改的

set java_exe=C:\Program Files\Java\jdk1.7.0_75\bin\java.exe
rem call lib\find_java.bat
rem if not defined java_exe goto :EOF

NOTE : Copy and paste your own java.exe path directory as explained previously.注意:复制并粘贴您自己的 java.exe 路径目录,如前所述。

ORIGINAL原来的

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

MODIFIED修改的

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

NOTE : If your android sdk is 64bit then mention set swt_path=lib\\x86_64 otherwise if it is 32bit then keep it as set swt_path=lib\\x86注意:如果您的 android sdk 是 64 位,则提及 set swt_path=lib\\x86_64 否则,如果它是 32 位,则将其保留为 set swt_path=lib\\x86

  1. Done!完毕! Fire up android sdk from android.bat file or from eclipse.从 android.bat 文件或 eclipse 启动 android sdk。 It should open up just fine!打开应该没问题!

I tried almost all the solutions provided here.我尝试了这里提供的几乎所有解决方案。 But nothing worked out.但没有任何结果。 And finally, I downloaded tools(tools_r25.2.3-windows.zip) from the below link and replaced the tools sub-folder in the sdk folder.最后,我从下面的链接下载了工具(tools_r25.2.3-windows.zip)并替换了 sdk 文件夹中的工具子文件夹。 It started working.它开始工作了。

https://developer.android.com/studio/index.html#downloads https://developer.android.com/studio/index.html#downloads

Sharing this as an information though it's an old thread.尽管这是一个旧线程,但仍将其作为信息共享。

I recently faced this problem after I installed android emulator using the sdk manager of android studio - which also upgraded my android sdk tools to 26.0.1 (as it was a prerequisite - according to the sdk manager of android studio).我最近在使用 android studio 的 sdk 管理器安装了 android 模拟器后遇到了这个问题 - 这也将我的 android sdk 工具升级到了 26.0.1(因为它是一个先决条件 - 根据 android studio 的 sdk 管理器)。

In my case, I simply replaced the tools folder of android sdk with tools folder from an older android sdk.就我而言,我只是将 android sdk 的tools文件夹替换为旧版 android sdk 中的tools文件夹。 This downgraded the android sdk tools, but now I can open the sdk manager using SDK Manager.exe .这降级了 android sdk 工具,但现在我可以使用SDK Manager.exe打开 sdk 管理器。

Been trying to get the SDK manager to run for a while now following various threads with similar problems I could find.一直在尝试让 SDK 管理器运行一段时间,现在关注我能找到的具有类似问题的各种线程。

Another solution to consider is to move android SDK to a dir without spaces in its name.另一个需要考虑的解决方案是将 android SDK 移动到名称中没有空格的目录。

For instance in my case it resided in:例如,在我的情况下,它驻留在:

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

and would fail.并且会失败。 When moved to:当搬到:

c:\android_sdk_sucks\

It worked.有效。

I have solved this issue.我已经解决了这个问题。 If you are not able to open "SDK Manager.exe" from explorer or if you are facing any problem with SDK Manager.如果您无法从资源管理器中打开“SDK Manager.exe”,或者您在使用 SDK Manager 时遇到任何问题。

Firstly check Java path is given in Environment Variable.首先检查环境变量中给出的Java路径。 (run Java command on CMD, or run Where Java on CMD as Administrator). (在 CMD 上运行 Java 命令,或在 CMD 上以管理员身份运行 Where Java)。 If Java command is recognized, there might not be problem with Java如果Java命令被识别,则Java可能没有问题

This might be due to broken SDK Tools.这可能是由于 SDK 工具损坏。 To fix it firstly rename tools folder (Android\\Sdk\\tools) to tools.old .要修复它,首先将tools文件夹(Android\\Sdk\\tools)重命名为tools.old Now download https://dl.google.com/android /repository/tools_r25.2.3-windows.zip?hl=id .现在下载https://dl.google.com/android /repository/tools_r25.2.3-windows.zip?hl=id After that Extract the downloaded zip files to Android\\Sdk\\ hence new tools folder would be extracted with all the contents for SDK.之后,将下载的 zip 文件解压缩到Android\\Sdk\\因此新的tools文件夹将与 SDK 的所有内容一起解压缩。 Now open SDK Manager.exe .现在打开SDK Manager.exe If it opens your issue is solved.如果它打开,您的问题就解决了。 Please note that SDK Manager.exe is a launcher file that launches Android\\Sdk\\tools\\bin\\sdkmanager.bat .请注意,SDK Manager.exe 是一个启动文件,用于启动Android\\Sdk\\tools\\bin\\sdkmanager.bat if you are satisfied with the answer please Upvote so that maximum users would solve the issue.如果您对答案感到满意,请点赞,以便最大限度地解决问题。 For further help visit this page https://answers.unity.com/questions/1320150/unable-to-list-target-platform.html如需进一步帮助,请访问此页面https://answers.unity.com/questions/1320150/unable-to-list-target-platform.html

Also make sure there is not as JRE before your JDK in PATH on Windows.还要确保 Windows 上的 PATH 中的 JDK 之前没有 JRE。 Oracle always stuffs its own JRE into the path before anything else (I had installed Oracle Lite after I installed the android sdk). Oracle 总是先将自己的 JRE 塞入路径中(我在安装 android sdk 后安装了 Oracle Lite)。

Same problem here, I tried all solutions but nothing worked.同样的问题,我尝试了所有解决方案,但没有任何效果。 Then I went into C:\\Users\\User_name and deleted the ".android" folder and then, the SDK Manager could open normally, and automatically created other ".android" folder.然后我进入C:\\Users\\User_name删除“.android”文件夹,然后SDK Manager可以正常打开,并自动创建另一个“.android”文件夹。

I tried all the most popular solutions before and no one worked for me, until I realised that the Android SDK folder must not have any spaces, so I changed it from "C:\\Android SDK" to "C:\\Android_SDK".之前我尝试了所有最流行的解决方案,但没有人为我工作,直到我意识到Android SDK文件夹不能有任何空格,所以我将其从“C:\\Android SDK”更改为“C:\\Android_SDK”。 As simple as that.就如此容易。

Nothing helps me from all this answers, but I found the right steps (Windows 7 64 bit):所有这些答案都没有帮助我,但我找到了正确的步骤(Windows 7 64位):

1) Open android.bat from your sdk folder for editing; 1) 从您的 sdk 文件夹中打开 android.bat 进行编辑;

2) Add exactly this two strings : 2)准确添加这两个字符串

set java_exe=c:\Program Files\Java\jdk1.8.0_25\bin\java.exe
rem call lib\find_java.bat

instead of this :而不是这个

set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF

Where c:\\Program Files\\Java\\jdk1.8.0_25 is your jdk folder.其中c:\\Program Files\\Java\\jdk1.8.0_25是您的 jdk 文件夹。 3) Enjoy. 3)享受。 SDK Manager will launch from Android studio IDE. SDK 管理器将从 Android Studio IDE 启动。

I installed Android Studio for Mac.我为 Mac 安装了 Android Studio。 I was not able to access the SDK manager through the IDE.我无法通过 IDE 访问 SDK 管理器。 It turns out I just had to have my JAVA_HOME environment variable set.原来我只需要设置我的 JAVA_HOME 环境变量。 Once I got this set I was able to launch the SDK manager.一旦我得到这个集合,我就能够启动 SDK 管理器。

I encountered a similar problem where SDK manager would flash a command window and die.我遇到了类似的问题,SDK 管理器会闪烁命令窗口并死机。

This is what worked for me: My processor and OS both are 64-bit.这对我有用:我的处理器和操作系统都是 64 位的。 I had installed 64-bit JDK version.我已经安装了 64 位 JDK 版本。 The problem wouldn't go away with reinstalling JDK or modifying path.问题不会随着重新安装 JDK 或修改路径而消失。 My theory was that SDK Manager may be needed 32-bit version of JDK.我的理论是 SDK Manager 可能需要 32 位版本的 JDK。 Don't know why that should matter but I ended up installing 32-bit version of JDK and magic.不知道为什么这很重要,但我最终安装了 32 位版本的 JDK 和魔法。 And SDK Manager successfully launched.并且 SDK Manager 成功启动。

I'd encountered the same problem.我遇到了同样的问题。 When running the android.bat I found the solution (if Java is installed in the 'normal' Windows directory, ie 'program files') you need to put quotes surrounding "c:/program files/" etc etc. Otherwise it cannot find java on "C:/program".运行 android.bat 时,我找到了解决方案(如果 Java 安装在“普通”Windows 目录中,即“程序文件”),您需要在“c:/program files/”等周围加上引号。否则找不到“C:/程序”上的java。 (me dislikes spaces) (我不喜欢空格)

The issue with mine was that I could run SDK manager through double clicking android.bat but not when I double click on the actual SDK manager application.我的问题是我可以通过双击 android.bat 来运行 SDK 管理器,但当我双击实际的 SDK 管理器应用程序时就不行了。 I solved this issue by setting a new environmental variable:我通过设置一个新的环境变量解决了这个问题:

ANDROID_HOME = C:\\Development\\adt-bundle-windows-x86_64-20130911\\sdk\\

restarted my pc and now I can double click on the application and run SDK Manager.重新启动我的电脑,现在我可以双击应用程序并运行 SDK Manager。 Hope that helps :)希望有帮助:)

OS: Windows 7- 64 bit, Android SDK: 64 bit操作系统:Windows 7- 64 位,Android SDK:64 位

  1. Introduce a new 'System variable' named: JAVA_HOME with value: C:\\Program Files\\Java\\jdk1.7.0_51引入一个名为:JAVA_HOME 的新“系统变量”,其值为:C:\\Program Files\\Java\\jdk1.7.0_51

  2. Right-click on SDK Manager.exe -> Run as administrator右键单击 SDK Manager.exe -> 以管理员身份运行

A check list:检查清单:

  • Make sure the java path in system variable 'Path' is something like: C:\\Program Files\\Java\\jdk1.7.0_51\\bin确保系统变量 'Path' 中的 java 路径类似于:C:\\Program Files\\Java\\jdk1.7.0_51\\bin
  • There is no space in your folder name, replace something like C:\\Android SDK with C:\\Android_SDK您的文件夹名称中没有空格,请将 C:\\Android SDK 之类的内容替换为 C:\\Android_SDK
  • You can find your java with 'where java' command in command line您可以在命令行中使用“where java”命令找到您的 java

I had same problem but after some time three of them appear because I clicked 3 times. 我遇到了同样的问题,但是一段时间后出现了三个,因为我单击了3次。 Just wait little bit, maybe you don't have a problem. 请稍等,也许您没有问题。

I saw answers that provide workaround solutions by hard coding java.exe location and x86 / x86_64 architecture string in sdk\\tools\\android.bat .我看到了通过在sdk\\tools\\android.bat硬编码java.exe位置和x86 / x86_64架构字符串来提供变通解决方案的答案。 Those are quick solutions but did not solve the fundamental issue that I am actually curious of.这些是快速解决方案,但并没有解决我真正好奇的根本问题。

The actual problem that I encountered is, the batch script is not able to find another script/jar file and thus is failed to proceed.我遇到的实际问题是,批处理脚本无法找到另一个脚本/jar 文件,因此无法继续。 I could say the script was poorly written.我可以说剧本写得不好。

After I made the following changes in sdk\\tools\\android.bat , everything works like a charm.sdk\\tools\\android.bat进行以下更改后,一切都像魅力一样。

Specifically, I added %~dp0\\ :具体来说,我添加了%~dp0\\

set java_exe=
call %~dp0\lib\find_java.bat
if not defined java_exe goto :EOF

...

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

Now, try to launch the script and SDK Manager should come out.现在,尝试启动脚本,SDK Manager 应该会出来。

ps My installation of OS, Java 8 and Android SDK are fresh and I did not do any of the extra configuration. ps 我安装的操作系统、Java 8 和 Android SDK 都是全新的,我没有做任何额外的配置。

ps You may still need to configure PATH environment variable so that the script could find the suitable java.exe . ps 您可能仍然需要配置 PATH 环境变量,以便脚本可以找到合适的java.exe

我测试了每一种方式,但唯一有效的方法是在与旧的相同的路径中重新安装 sdk-manager

http://quantumsupport.blogspot.com/2011/03/android-sdk-managerexe-wont-start.html http://quantumsupport.blogspot.com/2011/03/android-sdk-managerexe-wont-start.html

Create a new user account, either re-install or just start android.bat and it should work did for me创建一个新的用户帐户,重新安装或启动 android.bat,它应该对我有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM