4
votes

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.

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:

[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"

EDIT

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"

But application launch is still not successful. It is stuck at "Launching Appcelerator...:(57%)" The console output looks as follows :

    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: '<my email here>',
  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": "<HIDDEN>",
  "username": "<my email here>",
  "password": "<OMITTED>",
  "session": "<OMITTED>",
  "nonce": "<OMITTED>",
  "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": "<OMITTED>",
  "fingerprint": "a70646c9735845c52dd791bf727f8db1a0eca0a9",
  "fingerprint_description": "Windows Machine ID: <HIDDEN>",
  "org_id": <HIDDEN>,
  "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',
  '<my email here>',
  '--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' ]

Android SDK Manager output

UPDATE 2

I think I have progressed one step further with this-

  • I re-installed Android SDKs a couple of times.
  • Edited my tiapp.xml and added <uses-sdk minSdkVersion="10" targetSdkVersion="21"/>
  • Tried generating the apk using the ti build command.

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 appc ti build -b command :

[ERROR] Failed to run dexer:
[ERROR]
[ERROR] :
Error: Unable to access jarfile null

It looks like there is an empty parameter ("") after "-jar" in the Running dexer command which is causing the problem :

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..

To cut the long story short I will create a separate SO question for the above issue.

appc ti setup check output:

    ──────────────────┤ 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
2
Mmm, yes.. the value for that jar arguments should be something like "C:\android-sdk-win\build-tools\21.1.2\lib\dx.jar". Surely something is wrong here. What does "appc ti setup check" give you? - Fokke Zandbergen
The comment REM Locate dx.jar in the directory where dx.bat was found and start it. in the dx.bat suggests that dx.jar should be present in the same directory as dx.bat but actually its present under lib (C:\android-sdk-win\build-tools\21.1.1\lib) - Tarun Gupta
Did you manage to fix the node-appc missing thing? I am also seeing that, but npm install won't fix it. (I'm on a Mac btw) - Joris van Liempd iDeveloper
Have burned a full day on the exact steps you followed, I wonder if you were able to solve this issue. I am seeing: [ERROR] Application Installer abnormal process termination. Process exit value was 1 [ERROR] : Failed to run dexer: [ERROR] : Error: Unable to access jarfile null | TRACE | titanium exited with exit code 1 | ERROR | Error: ti run exited with error code 1 - Yozef
I was not able to fix these errors, after spending around 2 days on it. Finally installing every thing from scratch on my Mac OS worked fine for me. - Tarun Gupta

2 Answers

3
votes

Well, I had the same issue this week, and I've saw that the problem was that the titanium cli was pointing to a "build-tools" version that wasn't installed in my machine.

I've verified this through the command:

appc ti setup check

The return of it was the same as yours:

 x  build tools        unsupported version 21.0.0

So, to config correctly the version of the build-tools, I've run the command:

titanium config android.buildTools.selectVersion "<YOUR VERSION>"
titanium config android.buildTools.selectedVersion "<YOUR VERSION>"

Then, restart the cmd and run the build command again, and it should be fine. If even after this the problem persists and the build-tools stay as "unsupported", try to download via SDK Manager a new version of it, and change it with the same commands above.

1
votes

There must be something wrong with your Android SDK. It looks like you managed to fix some of it by setting the paths to each of the required tools, but it must still be breaking Titanium somewhere else. What is the contents of C:\android-sdk-win? What path did you set android.executables.aapt and others to?