title: Appcelerator studio fails to Launch my Android App
body: <p>I am new to Appcelerator, I have recently installed Appcelerator Studio on my Windows 7 64 bit machine. I have Android SDKs - 5.1.1 and 5.1.0. I have also changed the android version from 22.0.0 (default) to 21.0.0 using the "appc ti config" command as it was showing a warning with default android version.</p>
  
  <p>I am now trying to launch a test application on my android phone. Appcelerator studio is able to discover my device, but when I run the app I am getting following error:  </p>
  
  <pre><code>[ERROR] :  Missing required Android SDK tools: zipalign, aapt, aidl, dx
  [ERROR] :  
  [ERROR] :  The Android SDK located at C:\android-sdk-win has incomplete or out-of-date packages.
  [ERROR] :  
  [ERROR] :  Current installed Android SDK tools:
  [ERROR] :    Android SDK Tools:          24.3.3
  [ERROR] :    Android SDK Platform Tools: 22.0.0
  [ERROR] :    Android SDK Build Tools:    21.0.0
  [ERROR] :  
  [ERROR] :  Make sure you have the latest Android SDK Tools, Platform Tools, and Build Tools installed.
  [ERROR] :  
  [ERROR] :  You can also specify the exact location of these required tools by running:
  [ERROR] :    appc ti config android.executables.zipalign "C:\path\to\android-sdk\zipalign.exe"
  [ERROR] :    appc ti config android.executables.aapt "C:\path\to\android-sdk\aapt.exe"
  [ERROR] :    appc ti config android.executables.aidl "C:\path\to\android-sdk\aidl.exe"
  [ERROR] :    appc ti config android.executables.dx "C:\path\to\android-sdk\dx.bat"
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I was able to resolve the above error by running the commands like 'appc ti config android.executables.aapt "C:\path\to\android-sdk\aapt.exe"</p>
  
  <p>But application launch is still not successful. It is stuck at "Launching Appcelerator...:(57%)" The console output looks as follows :</p>
  
  <pre><code>    Appcelerator Command-Line Interface, version 4.0.2
  Copyright (c) 2014-2015, Appcelerator, Inc.  All Rights Reserved.
  TRACE  | __command__ search paths:
  [
    "C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package",
    "C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package\\node_modules",
    "C:\\Windows\\system32\\node_modules",
    "C:\\Windows\\node_modules",
    "C:\\node_modules",
    "C:\\Users\\username\\.appcelerator\\.npm\\lib\\node_modules"
  ]
  DEBUG  | [PLUGIN-LOAD] 1ms C:\Users\username\.appcelerator\install\4.0.2\package\appc.js
  DEBUG  | [PLUGIN-LOAD] 2058ms C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\appc-cli-titanium\appc.js
  DEBUG  | [PLUGIN-LOAD] 2ms C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\arrow\appc.js
  log level set to "trace"
  executing command "run"
  set environment to {"registry":"https://software.appcelerator.com","security":"https://security.appcelerator.com","baseurl":"https://platform.appcelerator.com"}
  checking credentials for existing session
  Attempting to load session info from config file
  check if session is invalidated
  session expiry 1436363230210 false
  ACS config file: C:\Users\username\.acs
  found ACS login { mid: '78-84-3C-EB-1E-EE',
    username: '&lt;my email here&gt;',
    cookie: [ 'connect.sid=s%3ANzD7%2F4ddUCpGeXpMINQQqfbr.yg%2BuCo3wTu7J%2Fy%2Bcf1VFefQVIjyOKnB9AxlzX5rd8WY; path=/; expires=Wed, 08 Jul 2015 13:46:11 GMT; httpOnly' ],
    publishHost: 'https://admin.cloudapp-enterprise.appcelerator.com',
    publishPort: 443,
    defaultEP: 
     { publishHost: 'https://admin.cloudapp-enterprise.appcelerator.com',
       publishPort: 443 } } , checking nodeACSEndpoint= https://admin.cloudapp-enterprise.appcelerator.com
  ACS cookie expiry [ 1436363171000 ]
  session already loaded in opts.session
  getCredentials() session:
  {
    "ipaddress": "&lt;HIDDEN&gt;",
    "username": "&lt;my email here&gt;",
    "password": "&lt;OMITTED&gt;",
    "session": "&lt;OMITTED&gt;",
    "nonce": "&lt;OMITTED&gt;",
    "environment": {
      "name": "production",
      "isProduction": true,
      "acsBaseUrl": "https://api.cloud.appcelerator.com",
      "acsAuthBaseUrl": "https://secure-identity.cloud.appcelerator.com",
      "nodeACSEndpoint": "https://admin.cloudapp-enterprise.appcelerator.com"
    },
    "token": "&lt;OMITTED&gt;",
    "fingerprint": "a70646c9735845c52dd791bf727f8db1a0eca0a9",
    "fingerprint_description": "Windows Machine ID: &lt;HIDDEN&gt;",
    "org_id": &lt;HIDDEN&gt;,
    "expiry": 1436363230210
  }
  loading plugins for command "run"
  run search paths:
  [
    "C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package",
    "C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package\\node_modules",
    "C:\\Windows\\system32\\node_modules",
    "C:\\Windows\\node_modules",
    "C:\\node_modules",
    "C:\\Users\\username\\.appcelerator\\.npm\\lib\\node_modules"
  ]
  [PLUGIN-LOAD] 0ms C:\Users\username\.appcelerator\install\4.0.2\package\appc.js
  [PLUGIN-LOAD] 992ms C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\appc-cli-titanium\appc.js
  run plugin: C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\appc-cli-titanium
  [PLUGIN-LOAD] 4ms C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\arrow\appc.js
  run plugin: C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\arrow
  plugin "arrow" failed its "when" function check, skipping...
  loading plugin "titanium" for command "run" CLI options via function
  loading plugin "titanium" for command "run" CLI options via array
  Duplicate option "colors" for command "run", removing...
  executing command "run" with the following plugins:
  ["titanium"]
  TRACE  | Attempting to load session info from config file
  TRACE  | check if session is invalidated
  TRACE  | session expiry 1436363230210 false
  TRACE  | session already loaded in opts.session
  DEBUG  | Titanium Downloads Last Checked: 1436257959200
  TRACE  | "C:\Program Files\nodejs\node.exe" "C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\appc-cli-titanium\node_modules\titanium\bin\titanium" config -o json-object
  TRACE  | "C:\Program Files\nodejs\node.exe" "C:\Users\username\.appcelerator\install\4.0.2\package\node_modules\appc-cli-titanium\node_modules\titanium\bin\titanium" sdk -o json
  TRACE  | checking for titanium, result:
   { activeSDK: '4.0.0.GA',
    defaultInstallLocation: 'C:\\ProgramData\\Titanium',
    installLocations: 
     [ 'C:\\ProgramData\\Titanium',
       'C:\\Users\\username\\AppData\\Roaming\\Titanium',
       'C:\\ProgramData\\Application Data\\Titanium' ],
    installed: { '4.0.0.GA': 'C:\\ProgramData\\Titanium\\mobilesdk\\win32\\4.0.0.GA' } }
  TRACE  | C:\Program Files\nodejs\node.exe [ 'C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package\\node_modules\\appc-cli-titanium\\node_modules\\titanium\\bin\\titanium',
    'build',
    '--platform',
    'android',
    '--log-level',
    'trace',
    '--sdk',
    '4.0.0.GA',
    '--project-dir',
    'C:\\work\\Appcelerator\\Favebooks',
    '--target',
    'device',
    '--android-sdk',
    'C:\\android-sdk-win',
    '--device-id',
    'TA09407S62',
    '--liveview',
    '--deploy-type',
    'development',
    '--no-colors',
    '--no-progress-bars',
    '--no-prompt',
    '--prompt-type',
    'socket-bundle',
    '--prompt-port',
    '49577',
    '--username',
    '&lt;my email here&gt;',
    '--password',
    '[HIDDEN]',
    '--plugin-paths',
    'C:\\Users\\username\\.appcelerator\\install\\4.0.2\\package\\node_modules',
    '--config-file',
    'C:\\Users\\username\\AppData\\Local\\Temp\\build-1436281919408.json',
    '--no-banner' ]
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/NZZiL.png" alt="Android SDK Manager output"></p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>I think I have progressed one step further with this- </p>
  
  <ul>
  <li>I re-installed Android SDKs a couple of times.</li>
  <li>Edited my tiapp.xml and added <code>&lt;uses-sdk minSdkVersion="10" targetSdkVersion="21"/&gt;</code></li>
  <li>Tried generating the apk using the <code>ti build</code> command.</li>
  </ul>
  
  <p>Current status is that the app launch using Appcelerator Studio still fails. And I am getting the following error when I try to build the apk file using Titanium CLI i.e. the <code>appc ti build -b</code> command :</p>
  
  <pre><code>[ERROR] Failed to run dexer:
  [ERROR]
  [ERROR] :
  Error: Unable to access jarfile null
  </code></pre>
  
  <p>It looks like there is an empty parameter ("") after "-jar" in the <code>Running dexer</code> command which is causing the problem :</p>
  
  <pre><code>C:\Progra~2\Java\jdk1.7.0_06\bin\java.exe "-Xmx1024M" "-XX:-UseGCOverheadLimit" "-Djava.ext.dirs=C:\android-sdk-win\platform-tools" "-jar" "" "--dex" "--output=C:\work\Appcelerator\Favebooks\build\android\bin\classes.dex" "C:\work\Appcelerator\Favebooks\build\android\bin\classes" "C:\ProgramData\Titanium\mobilesdk\win32\4.0.0.GA\android\lib\titanium-verify.jar" ..long list of jar files..
  </code></pre>
  
  <p>To cut the long story short I will create a separate SO question for the above issue.</p>
  
  <p><code>appc ti setup check</code> output:</p>
  
  <pre><code>    ──────────────────┤ Check Environment ├───────────────────
  
  Node.js
    *  node               new version v0.12.6 available! (currently v0.12.2)
    *  npm                new version v3.1.0 available! (currently v2.7.4)
  
  Titanium CLI
    √  cli                up-to-date (v4.0.1)
  
  Titanium CLI Dependencies
    √  async              up-to-date (v0.2.10)
    √  colors             up-to-date (v0.6.2)
    √  fields             up-to-date (v0.1.24)
    √  humanize           up-to-date (v0.0.9)
    √  jade               up-to-date (v0.35.0)
    √  longjohn           up-to-date (v0.2.4)
    √  moment             up-to-date (v2.4.0)
    x  node-appc          missing
    √  optimist           up-to-date (v0.6.1)
    √  request            up-to-date (v2.27.0)
    √  semver             up-to-date (v2.2.1)
    √  sprintf            up-to-date (v0.1.5)
    √  temp               up-to-date (v0.6.0)
    √  winston            up-to-date (v0.6.2)
    x  wrench             missing
  
  Titanium SDK
    √  latest sdk         installed (v4.0.0.GA)
    x  selected sdk       selected Titanium SDK "vundefined" is not installed
  
  Android Environment
    √  sdk                installed (C:\android-sdk-win)
    !  tools              untested version 24.3.3; may or may not work
    √  platform tools     installed (v22.0.0)
    x  build tools        unsupported version 21.0.0
    √  adb                installed C:\android-sdk-win\platform-tools\adb.exe
    √  android            installed C:\android-sdk-win\tools\android.bat
    √  emulator           installed C:\android-sdk-win\tools\emulator.exe
    √  mksdcard           installed C:\android-sdk-win\tools\mksdcard.exe
    √  zipalign           installed C:\android-sdk-win\build-tools\21.1.1\zipalign.exe
    √  aapt               installed C:\android-sdk-win\build-tools\21.1.1\aapt.exe
    √  aidl               installed C:\android-sdk-win\build-tools\21.1.1\aidl.exe
    √  targets            installed (3 found)
    √  avds               installed (6 found)
    √  ndk                installed (undefined)
    √  ndk-build          installed (undefined)
  
  Java Development Kit
    √  jdk                installed (v1.7.0)
    √  java               installed C:\Progra~2\Java\jdk1.7.0_06\bin\java.exe
    √  javac              installed C:\Progra~2\Java\jdk1.7.0_06\bin\javac.exe
    √  keytool            installed C:\Progra~2\Java\jdk1.7.0_06\bin\keytool.exe
    √  jarsigner          installed C:\Progra~2\Java\jdk1.7.0_06\bin\jarsigner.exe
  
  Intelr Hardware Accelerated Execution Manager (HAXM)
    √  compatible
    √  installed
  
  Network
    √  online
    -  no proxy server configured
    √  Network connection test
    √  Java-based connection test
  
  Directory Permissions
    √  home directory
    √  titanium config directory
    √  titanium sdk install directory
    √  temp directory
  </code></pre>