Error running Android emulator from Titanium Studio

appceleratortitanium

Basically trying to get the default sample project (which is linked to here) to run in the Android simulator.

(I'm on Windows XP-SP3, see the "Diagnostics Log" output in the question's footer for more config info, if you have any questions about configs let me know.)

Here's what I've done so far:

  • Installed the current version of Titanium Mobile SDK Version: 2.0.1
  • Installed the Java SDK "jdk-6u31-windows-i586.exe"
  • Installed the Android SDK Manager r18, then the following packages: Android SDK Tools, Android SDK Platform Tools, Android 2.2 API-8 SDK Platform, Android 2.2 API-8 Google APIs
  • Downloaded the zip of Kitchen Sink on GitHub, unzipped the file, changed the file name to KitchenSink, copied the file to the Titanium project directory under "My Documents", then via the file tab executed an import on that directory to the "Project Explorer" tab in Titanium Studio.
  • Then I right clicked on the KitchenSink project in "Project Explorer" tab in Titanium Studio, and selected "Run As…", then "Android Emulator"
  • Oddly, doing this returns different results (meaning I run it, restart, etc.), which include:
    • ERROR-MSG: Problem Occurred 'Launching Titanium Android Emulator – KitchenSink' has encountered a problem. Session initialization failed. Connection refused: connect.
    • Another times, I've gotten a message in this form "[INFO] [2012-04-24 17:03:33,140] Serving up files for com.test.test at 0.0.0.0:1133 from C:\Documents and Settings\user\My Documents\Titanium Studio Workspace\test" which appears to as the app was deploy to a server under an static-IP, but no emulator ever appears; which to me seemed like a bad IP address, though might be wrong.

What do I need to do to get KitchenSink to run in the Android Simulator? Is there a way to just run the Android Simulator to confirm it's working on it's own?


Here's the full output from the "Diagnostics Log" under the help tab:

  • Host OS: Windows XP
  • OS Arch: x86
  • JRE Version: 1.6.0_24
  • JRE Vendor: Sun Microsystems Inc.
  • JRE Home: C:\Program Files\Appcelerator\Titanium Studio\jre
  • Install Directory: file:/C:/Program Files/Appcelerator/Titanium Studio/
  • Version: 2.0.1.201204132053
  • VM Arguments: -Xms40m -Xmx1024m -Declipse.p2.unsignedPolicy=allow -Declipse.log.size.max=10000
    -Declipse.log.backup.max=5
    -Djava.awt.headless=true
    -XX:MaxPermSize=256m
    -Djava.class.path=C:\Program Files\Appcelerator\Titanium Studio\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
  • Workspace Directory: file:/C:/Documents and Settings/user/My Documents/Titanium Studio Workspace/
  • Language: en_US
  • Titanium Desktop SDK Version: 1.1.0
  • Titanium Desktop SDK Location: C:\Documents and Settings\user\Application Data\Titanium\sdk\win32\1.1.0
  • Titanium Mobile SDK Version: 2.0.1
  • Mobile SDK Modules API Version: 2
  • Mobile SDK Timestamp: 04/12/12 16:33
  • Mobile SDK Build Number: 999c68a
  • Titanium Mobile SDK Location: C:\Documents and Settings\user\Application Data\Titanium\mobilesdk\win32\2.0.1.GA2

Per the suggestion below, I created a new mobile project targeting Android, and then ran the project using the "Run As…" Android emulator option. The system returned this messages: "[INFO] [2012-04-24 17:03:33,140] Serving up files for com.test.test at 0.0.0.0:1133 from C:\Documents and Settings\user\My Documents\Titanium Studio Workspace\test"

build.log Output:
C:\Documents and Settings\user\My Documents\Titanium Studio Workspace\test\build.log

Logfile initialized
[INFO] logfile = C:\Documents and Settings\user\My Documents\Titanium Studio Workspace\test\build.log
[DEBUG] C:\Documents and Settings\user\Application Data\Titanium\mobilesdk\win32\2.0.1.GA2\android\builder.py simulator test C:\Program Files\Android\android-sdk C:\Documents and Settings\user\My Documents\Titanium Studio Workspace\test com.test.test 1 HVGA
[INFO] logfile = C:\Documents and Settings\user\My Documents\Titanium Studio Workspace\test\build.log
[DEBUG] C:\Documents and Settings\user\Application Data\Titanium\mobilesdk\win32\2.0.1.GA2\android\builder.py emulator test C:\Program Files\Android\android-sdk C:\Documents and Settings\user\My Documents\Titanium Studio Workspace\test com.test.test 1 HVGA
[ERROR] Error locating JDK: set $JAVA_HOME or put javac and jarsigner on your $PATH
[ERROR] Error locating JDK: set $JAVA_HOME or put javac and jarsigner on your $PATH

**Windows commands (java,javac,jarsigner) all return valid responses, which appears to conflict with the build.log file saying the JDK is not in the file path. The path is currently set as:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;"C:\Program Files\Java\jdk1.6.0_31\bin"

UPDATE:

Logfile initialized
[INFO] logfile = C:\Documents and Settings\user\My Documents\Titanium Studio Workspace\test3\build.log
[DEBUG] C:\Documents and Settings\user\Application Data\Titanium\mobilesdk\win32\2.0.1.GA2\android\builder.py simulator test3 C:\Program Files\Android\android-sdk C:\Documents and Settings\user\My Documents\Titanium Studio Workspace\test3 com.tester.test3 1 HVGA
[INFO] Building test3 for Android ... one moment
[ERROR] JDK version 'javac' is not recognized as an internal or external command,

operable program or batch file. detected, but 1.6 is required

Best Answer

Step one to see is ur config ok, create a new project and run that, it should have a default app.js page with 2 tabs on it, if that doesn't work its a config issue

if that fails try following the steps here for setting up titanium: http://docs.appcelerator.com/titanium/2.0/index.html#!/guide/Setting_up_Titanium_Studio-section-30086257_SettingupTitaniumStudio-SoftwareLocations

Or here for setting up environment variables: http://docs.appcelerator.com/titanium/2.0/index.html#!/guide/Software_Locations_and_Environment_Variables

Related Topic