title: ANDROID_SDK_ROOT=undefined (recommended setting) while building ionic app using Cordova for Android device
body: <p>I am trying to build an ionic app for Android device with Cordova using the below command from VSCode.</p>
  <pre><code>ionic cordova build android --prod --release
  </code></pre>
  <p>But I'm getting this error:</p>
  <pre><code>cordova.cmd build android --release
  Checking Java JDK and Android SDK versions
  ANDROID_SDK_ROOT=undefined (recommended setting)
  ANDROID_HOME=C:\Users\tanmay\AppData\Local\Android\sdk (DEPRECATED)
  Could not find an installed version of Gradle either in Android Studio,
  or on your system to install the gradle wrapper. Please include gradle
  in your path, or install Android Studio
  [ERROR] An error occurred while running subprocess cordova.
  
          cordova.cmd build android --release exited with exit code 1.
  </code></pre>
  <p>I have already installed JDK, Android Studio. I also have setup the environment variable <code>ANDROID_SDK_ROOT</code> with the correct SDK path. But still no luck.</p>
  <p>I am using
  Android Studio 3.6.1,
  Gradle 6.3,
  Cordova 8.1,
  on Windows 10.</p>
  <p>I guess I am somewhere missing the setting the <code>ANDROID_SDK_ROOT</code> but I'm not sure where.</p>