How to fix “Error - Failed to execute tools\android.bat, error 2 ” in Android?

后端 未结 13 1521
死守一世寂寞
死守一世寂寞 2020-12-17 10:28

When i click on AVD Manager, i am getting an error as in the screenshot below.

Referred to the following links. But none of the solution works for me.

Failed

相关标签:
13条回答
  • 2020-12-17 10:37

    Check that if the tools folder is missing in /sdk folder. If so, just unzip again from the zip package to the /sdk folder again. It works like charm for my case.

    cheers.

    i think it occurs when i accidentally hit delete packages button.

    0 讨论(0)
  • 2020-12-17 10:41

    My situation: Right after installing Android support into Visual Studio, the "Open Android Emulator Manager (AVD)" button was broken and running C:\Program Files (x86)\Android\android-sdk\tools\lib\AVD Manager.exe produces the error shown by the OP. The screenshot in yean's answer shows an android-sdk folder that contains AVD Manager.exe, but my android-sdk folder did not contain any files (only folders).

    Crazy as it sounds, simply copying AVD Manager.exe from android-sdk\tools\lib to android-sdk fixes both problems. (I couldn't create an API-18 arm emulator but API-19 worked.)

    0 讨论(0)
  • 2020-12-17 10:46

    I had this problem and downloaded tools_r25.2.3-windows.zip file. I think this problem caused on updating tools. I deleted tools to update but this error occured when I installed. Be careful updating.

    0 讨论(0)
  • 2020-12-17 10:46

    This wasn't working for me as I did not have this bat file nor the tools directory at all. And my temp directory did not have any zipped tools directory, so could not just replace.

    MS suggested doing repair install

    1. Open the Windows Programs and Features Control Panel.
    2. Right click the relevant Microsoft Visual Studio entry, and select Change
    3. Click the Repair button in the Visual Studio dialog that opens.

    That resolved my issue

    0 讨论(0)
  • 2020-12-17 10:50

    Happened several times on my environment. @Mahmood and @Qwertie solutions did help, until today.

    Banged my head the whole afternoon searching & trying many solutions... finally this one unlocked the situation:

    Remove hidden directory C:\Users\{yourUserName}\.android

    0 讨论(0)
  • 2020-12-17 10:52

    Please copy the AVD Manager. Exe to the SDK Manager. Exe's directory which is the root directory of the SDK.

    0 讨论(0)
提交回复
热议问题