title: Cordova error running on android emulator: "android: Command failed with exit code 2"
body: <p>I'm trying to run my cordova project in an android emulator:</p>
  
  <pre><code>cordova emulate android
  </code></pre>
  
  <p>The build is successful but the emulator is not starting and I get an error:</p>
  
  <pre><code>Error: android: Command failed with exit code 2
  </code></pre>
  
  <p>I get the same thing when running <code>cordova requirements</code>:</p>
  
  <pre><code>Requirements check results for android:
  Java JDK: installed 1.8.0
  Android SDK: installed true
  Android target: not installed
  android: Command failed with exit code 2
  Gradle: installed /opt/android-studio/gradle/gradle-3.2/bin/gradle
  Error: Some of requirements check failed
  </code></pre>
  
  <p>I've upgraded Android SDK Tools to 26.0.1 and <code>android</code> command doesn't work for me anymore. So I installed <code>cordova-android@6.2.1</code> as the <a href="https://cordova.apache.org/announcements/2017/04/05/android-release.html" rel="noreferrer">release page</a> says and use it in my project:</p>
  
  <pre><code>$ cordova platform ls
  Installed platforms:
    android 6.2.1
  Available platforms:
    amazon-fireos ~3.6.3 (deprecated)
    blackberry10 ~3.8.0
    browser ~4.1.0
    firefoxos ~3.6.3
    ubuntu ~4.3.4
    webos ~3.7.0
  </code></pre>
  
  <p>But the error still happens. Does anyone has any ideas why this happens?</p>