I am having problem to build android with Cordova, when I execute cordova build android
, I receive this error:
Error: Android SDK not found. Ma
As someone else stated, it is because of the android command being deprecated:
C:\>android ************************************************************************** The "android" command is deprecated. For manual SDK, AVD, and project management, please use Android Studio. For command-line tools, use tools\bin\sdkmanager.bat and tools\bin\avdmanager.bat **************************************************************************
In my case, I managed to fix it changing the newer android.bat that is bundled in the sdk, in the "tools" folder.
Just change this lines in the sdk/tools/android.bat
:
From this: (Line ~20)
set avd_objects=;avd;target;device;
To:
set avd_objects=;avd;targets;device;
From This: (Line ~37)
echo android list target
To:
echo android list targets
Explanation: The cordova build.bat will eventually call check_reqs.js script, and thats where this validation is done. If you look for the actual error text, it shows that the script is trying to call "android list targets --compact" command, which I assume was the older way to do it.