title: Can't specify Android API level in cordova
body: <p>When I upgraded my LG Nexus 4 phone from Android 4.4.4 to 5.0.1, my App stopped working (connecting to a Arduino Adafruit EZ-Link Bluetooth shield).  The only hint/idea I have right now is that the cordova build is using API 19 (Android 4.4.2) instead of API 21 (5.0.1).</p>
  
  <p>I've rebuilt the App and everything else to know about API 21 (5.0.1) but I cannot get cordova to use it.  It insists upon using API target 19.</p>
  
  <p>Many people say do <em>NOT</em> change <em>platforms/android/AndroidManifest.xml</em>.
  Even if you do, it still will not work.
  Based on what I seen in 
  <a href="https://stackoverflow.com/questions/18384723/how-do-i-specify-the-android-api-level-in-phonegap">How do I specify the Android API Level in PhoneGap?</a>
  I updated my config.xml to include:</p>
  
  <pre><code>&lt;preference name="android-targetSdkVersion" value="21" /&gt; 
  &lt;preference name="android-minSdkVersion" value="14" /&gt;
  </code></pre>
  
  <p>but that doesn't work either.
  I blew away the old Android virtual device in AVD (Android Virtual Device) manager, and created a new one that uses API 21 and the API 21 stuff is installed from the Android SDK Manager.
  But when I do a <em>cordova build</em>, I still get:</p>
  
  <pre><code>[gettarget] Project Target:   Android 4.4.2
  [gettarget] API level:        19
  </code></pre>
  
  <p>If I specify using the <strong>--target</strong> option, it explodes with:</p>
  
  <pre><code>server5&gt; cordova build --target="android-21"
  Running command:         /usr/local/GrayAndWhite/cordova/wounds/platforms/android/cordova/build --target=android-21
  /usr/local/GrayAndWhite/cordova/wounds/platforms/android/cordova/node_modules/q/q.js:126
       throw e;
             ^
  TypeError: Cannot call method 'prepEnv' of undefined
  </code></pre>
  
  <p>API 21 is known about.  It I do a <em>cordova info</em>, I will get a</p>
  
  <pre><code>...
  id: 3 or "android-21"
       Name: Android 5.0.1
       Type: Platform
       API level: 21
       Revision: 2
  ...
  </code></pre>
  
  <p>I know the Arduino side of things is still ok, because the phone can pair to the device, the App can see the device, get it's MAC address, but cannot connect to it any more.</p>
  
  <p>I have not tried removing the API 19 stuff from the SDK.  I'd rather not do that since I'll probably want to be able to install this on other phones as well.</p>