简体   繁体   English

无法执行tools \\ android.bat:解决方案

[英]Failed to execute tools\android.bat: solution

When I try to open up the SDK Manager in eclipse it says opening shortly, but never opens. 当我尝试在Eclipse中打开SDK Manager时,它说即将打开,但从未打开。 I've tried to open the exe file but it displays an error message saying: 我试图打开exe文件,但显示错误消息:

Failed to execute tools\\android:bat the system cannot find the file specified 无法执行tools \\ android:bat,系统找不到指定的文件

My path environment variable leads it to the tools folder. 我的路径环境变量将其引导到tools文件夹。

This is the path: 这是路径:

C:\Users\Shan\Documents\Computer Science - YEAR 2\Android App Development\adt-bundle-windows-x86-20130917\sdk\tools

In my case the Tools directory just disappear . 就我而言, Tools 目录 消失了

..\\sdk\\tools .. \\ sdk \\ tools

To solve it: 解决方法:

1) Just go to SDK zip -> adt-bundle-windows-x86_64-20131030.zip 1)只需转到SDK zip-> adt-bundle-windows-x86_64-20131030.zip

2) Unzip the Tools Directory only. 2)仅解压缩工具目录。

3) copy it under ../sdk/ 3)将其复制到../sdk/

I had a similar problem today. 我今天也有类似的问题。 Press the Windows button and Search for android.bat(in the search programs and files text field) 按Windows按钮并搜索android.bat(在搜索程序和文件文本字段中)

Then copy the file to your android SDK folder ( C:\\Users\\Shan\\Documents\\Computer Science - YEAR 2\\Android App Development\\adt-bundle-windows-x86-20130917\\sdk\\tools\\ ). 然后将文件复制到您的android SDK文件夹( C:\\Users\\Shan\\Documents\\Computer Science - YEAR 2\\Android App Development\\adt-bundle-windows-x86-20130917\\sdk\\tools\\ )。

After that don't run SDK manager but run the android.bat file. 之后,不要运行SDK Manager,而是运行android.bat文件。

Hope this helps 希望这可以帮助

-Zaniar -扎纳尔

我必须将AVD管理器从/sdk/tools/lib移至根文件夹/sdk

Copy the AVD Manager.exe and SDK Manager.exe from 从中复制AVD Manager.exeSDK Manager.exe

SDK_ROOT_FOLDER/tools/lib/

into 进入

SDK_ROOT_FOLDER

I've been working with this problem for three days and finally was able to run SDK Manager by 我已经解决了这个问题三天了,终于能够通过

==> Running the android.bat file as administrator ==> 以管理员身份运行android.bat文件

Note: I did not have to make any changes to the .bat file (such as setting the java_exe path) in order for the manager to run. 注意:我不需要对.bat文件进行任何更改(例如,设置java_exe路径)即可运行管理器。

I saw this as a comment on the top answer but can't upvote yet, so confirming it here! 我将其视为对最佳答案的评论,但尚无法投票,因此请在此处确认!

I cancelled an update to Android Tools and it seems there's a bug with unzipping the old (or new?) version back into {android_sdk}/tools. 我取消了对Android Tools的更新,并且似乎存在将旧(或新?)版本解压缩到{android_sdk} / tools中的错误。 The zip is located in {android_sdk}/temp. 邮编位于{android_sdk} / temp。 Just unzip it into the right location and it should work again. 只需将其解压缩到正确的位置,它就可以再次工作。

如果接受的答案没有帮助任何人,则也可能是权限问题(例如,如果SDK安装在Program Files (x86) ,请尝试以管理员身份运行android.bat

I had the same issue when updating the Android SDK Tools and SDK Platform-tools from the SDK Manager. 从SDK Manager更新Android SDK工具和SDK平台工具时,我遇到了同样的问题。 I had to replace the tools folder with one located in a zip folder inside the temp folder. 我必须用位于temp文件夹中zip文件夹中的一个文件夹替换tools文件夹。

In My case, While I installed visual studio 2015, The SDK files were missed and I am getting an error window shown below. 就我而言,当我安装Visual Studio 2015时,SDK文件丢失了,并且出现如下所示的错误窗口。 在此处输入图片说明

So I manually downloaded the tools from the following URL. 因此,我从以下URL手动下载了这些工具。

tools_r24.0.2-windows tools_r24.0.2-windows

Then extract the zip file and copy the tools folder in the following location. 然后解压缩该zip文件,并在以下位置复制tools文件夹。

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

It worked for me. 它为我工作。

I think current Android SDK only works with JDK x86 version. 我认为当前的Android SDK仅适用于JDK x86版本。 I search so much but when installed JDK x86 version Android SDK manager worked without problem. 我搜索了很多内容,但是在安装JDK x86版本的Android SDK管理器时,没有出现问题。

将您的android.bat文件复制到C:\\adt-bundle-windows-x86_64-20140702\\sdk\\tools文件夹,或将所有文件复制到C:\\

If you are seeing this error, it may be an issue with your COMSPEC environment variable. 如果看到此错误,则可能是您的COMSPEC环境变量有问题。

Please see https://stackoverflow.com/a/27284746/3866013 for more details. 有关更多详细信息,请参阅https://stackoverflow.com/a/27284746/3866013

I had the same problem. 我有同样的问题。 Caused it myself because while runing Android SDK Manager i hit UNINSTALL SDK Tools. 我自己造成的原因是,在运行Android SDK Manager时,我遇到了UNINSTALL SDK Tools。

I fixed the issue by running the installation of the Android SDK again. 我通过再次运行Android SDK的安装解决了该问题。 The installation folder had to be the same as previously. 安装文件夹必须与以前的文件夹相同。 After the installation, everything was back again as it was. 安装之后,一切又恢复了原样。

This is how I solved the problem on Windows 7: 这是我在Windows 7上解决问题的方式:
I was going to update the SDK using Android SDK Manager but android.bat was not found because previously it uninstall the older one and then installs new. 我打算使用Android SDK Manager更新SDK,但未找到android.bat,因为以前它会卸载较旧的版本,然后再安装新版本。 In my case my SDK Update was interrupted ie in other words, could not install after the SDK Manager uninstalled the tools, so my machine was not able to find android.bat. 在我的情况下,我的SDK更新被中断,也就是说,在SDK Manager卸载工具后无法安装,因此我的机器无法找到android.bat。 What I did was just downloaded the standalone SDK tools to the same folder where my SDK were from : 我所做的只是将独立的SDK工具下载到了我的SDK所在的文件夹中:

http://developer.android.com/sdk/index.html#Other http://developer.android.com/sdk/index.html#Other

https://developer.android.com/sdk/index.html#Other 

Here are two options for downloading the Android SDK for Windows users. 这是为Windows用户下载Android SDK的两个选项。 One in recommended option and the other is .zip file. 推荐的选项之一是.zip文件。 Zip file worked well. 压缩文件效果很好。 Another option may also work. 另一种选择也可能起作用。 Try searching android.bat with windows search engine. 尝试使用Windows搜索引擎搜索android.bat。 If you find the one, copy it and paste in SDK tools folder. 如果找到一个,请将其复制并粘贴到SDK tools文件夹中。

打开Sdk Manager.exe,然后我首先删除了Android Sdk工具,因此,我也出现了这样的错误,然后我下载了installer_r24.3.2-windows.exe,安装并复制了C:\\ Users \\ Super Man \\ AppData \\ Local \\ Android \\ android-sdk \\ tools文件夹到我的SDK路径,运行My Sdk Path \\ android.bat,确定!

I did the following : 我做了以下事情:

  1. I created a folder SDK right below my C-drive 我在C盘下方创建了一个文件夹SDK
  2. I unzipped tools_r25.2.3-windows.zip to C:\\SDK 我将tools_r25.2.3-windows.zip解压缩到C:\\ SDK
  3. I moved SDK Manager.exe from C:\\SDK\\tools\\lib to C:\\SDK 我将SDK Manager.exe从C:\\ SDK \\ tools \\ lib移到了C:\\ SDK
  4. I first ran SDK Manager.exe in 'normal mode',but this gave me the error, but when I ran SDK Manager.exe as ADMINISTRATOR it didn't return the error. 我首先以“正常模式”运行SDK Manager.exe,但这给了我错误,但是当我以ADMINISTRATOR身份运行SDK Manager.exe时没有返回错误。

The reg command exists but for unknown reason my path variable was corrupted during some installation. reg命令存在,但由于未知原因,我的路径变量在某些安装过程中已损坏。

So some basic element were missing: 因此缺少一些基本要素:

C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem

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

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