Prem Prem - 1 year ago 341
Android Question

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

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 to execute tools\android.bat: solution

Android SDK Windows Failed to execute Android.bat

In Tools -> Lib Folder i have my AVD Manager.

In Tools -> i have android.bat

I tried the following options and it did not work.

  1. Copied Android SDK Manager in Lib folder and clicked on AVD Manager. Got the same error.

  2. Copied AVD Manager to Tools folder and clicked AVD Manager. Got the same error.

Please find below the error screenshot.

enter image description here

Kindly let me know if any thoughts.

Answer Source

My android.bat file was missing when updating the particular SDK package and my computer suddenly shut down. Thus, my tools folder became empty.

enter image description here

You can recover your android.bat file from temp folder

enter image description here

  1. Manually unzip tools_r23.05-windows or any file (red color)

  2. Get a folder called tools (orange color)

  3. Copy all the file in this folder to the original tools folder (outside temp folder, e.g. D:\android-sdk\tools)

In my case, the problem was solved this way. Hope this helps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download