Prem Prem - 20 days ago 5
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

http://android.stackexchange.com/questions/33538/android-sdk-cant-find-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

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 tool_rXX.zip 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.