Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-508] cannot access org.appcelerator.titanium.TiRootActivity upon trying to deploy KitchenSink demo app on Android

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-07-25T13:18:20.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, class-not-found, deployment, droid, emulator, kitchensink
ReporterChris Wolf
AssigneeNeeraj Gupta
Created2011-04-15T02:30:32.000+0000
Updated2012-07-26T20:55:04.000+0000

Description

I cannot deploy the KitchenSink demo app on any form of Android emulator. I downloaded the
app via the download button (not git) which offered a zip or tar archive. The base directory
of the archive is:

ls -l appcelerator-KitchenSink-4d0db58/
total 32
drwxr-xr-x  3 cwolf  cwolf    102 Mar  2 00:49 0.8.1
drwxr-xr-x  2 cwolf  cwolf     68 Mar  2 00:48 0.9.x
-rwxr-xr-x  1 cwolf  cwolf  11485 Feb 26 09:39 LICENSE
-rwxr-xr-x  1 cwolf  cwolf    709 Feb 26 09:39 README.md

I imported the project into the Titanium IDE and set the log filter to "debug" and pressed
"launch" it seems to always have a class-not-found upon compilation phase. The relavant log output is:

[DEBUG] javac -classpath /opt/android-sdk/platforms/android-1.6/android.jar:/Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android/titanium.jar -d /Users/cwolf/Desktop/Downloads/appcelerator-KitchenSink-4d0db58/0.8.1/KitchenSink/build/android/bin/classes -sourcepath /Users/cwolf/Desktop/Downloads/appcelerator-KitchenSink-4d0db58/0.8.1/KitchenSink/build/android/src /Users/cwolf/Desktop/Downloads/appcelerator-KitchenSink-4d0db58/0.8.1/KitchenSink/build/android/src/com/appcelerator/kitchensink/KitchensinkActivity.java /Users/cwolf/Desktop/Downloads/appcelerator-KitchenSink-4d0db58/0.8.1/KitchenSink/build/android/src/com/appcelerator/kitchensink/KitchensinkAppInfo.java /Users/cwolf/Desktop/Downloads/appcelerator-KitchenSink-4d0db58/0.8.1/KitchenSink/build/android/src/com/appcelerator/kitchensink/KitchensinkApplication.java /Users/cwolf/Desktop/Downloads/appcelerator-KitchenSink-4d0db58/0.8.1/KitchenSink/build/android/src/com/appcelerator/kitchensink/R.java
[ERROR] javac /Users/cwolf/Desktop/Downloads/appcelerator-KitchenSink-4d0db58/0.8.1/KitchenSink/build/android/src/com/appcelerator/kitchensink/KitchensinkActivity.java:3: cannot access org.appcelerator.titanium.TiRootActivity

I tried both the "0.9.x" and "0.8.1" version of the KitchenSink app and got the same error.
Next, I looked at the javac command line (above) to see what jars were being referenced and
looked in the titanium.jar and see the class that's reported not found is, in fact, in the jar:

$ cd /Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android
$ jar tvf titanium.jar | grep TiRoot
   414 Mon Mar 01 20:14:56 EST 2010 org/appcelerator/titanium/TiRootActivity$TiActivityRef.class
   918 Mon Mar 01 20:14:56 EST 2010 org/appcelerator/titanium/TiRootActivity$1.class
  6043 Mon Mar 01 20:14:56 EST 2010 org/appcelerator/titanium/TiRootActivity.class

I have MacOS 10.5.8. Java version 1.5.0_22 (apple). I tried using all Android SDK emulations,
1.5, 1.6 and 2.0 (it would be helpful if a "readme" in KitchenSink indicated which to use)

Attachments

FileDateSize
kitchensink_eclipse.png2011-04-15T02:30:34.000+0000148453
mobiles.py2011-04-15T02:30:33.000+0000910

Comments

  1. Chris Wolf 2011-04-15

    Changing assignment from "none" to "Kevin Whinnery", since that's the submitter I see in the git log.

  2. Chris Wolf 2011-04-15

    I ran the Android SDK and AVD manager and updated to the latest versions and still get the problem.

  3. Chris Wolf 2011-04-15

    I tried loading the Eclipse project in the build subdirectory, just to see what would happen and got the result show in the attached screen shot.

  4. Chris Wolf 2011-04-15

    I cut&paste the javac command from the log (above) and used it to create a shell script to run the compiler from the command line and was able to see additional error info not displayed in the Titanium log:

       ./build/android/src/com/appcelerator/KitchenSink/KitchensinkActivity.java:3: cannot access org.appcelerator.titanium.TiRootActivity
       bad class file: /Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android/titanium.jar(org/appcelerator/titanium/TiRootActivity.class)
       class file has wrong version 50.0, should be 49.0
       Please remove or make sure it appears in the correct subdirectory of the classpath.
       import org.appcelerator.titanium.TiRootActivity;
       

    The class version mismatch indicated that I should be using JDK-1.6, not 1.5, which is the default setting on MacOS 10.5.8. I then used the Apple Java Preferences.app to change the JDK search order to try 1.6 first. This resolves the issue of building and running KitchenSink in the emulator.

    Unfortunately, I am now unable to deploy KitchenSink on a real device, in my case, a Motorola Droid running Android-2.0.

  5. Chris Wolf 2011-04-15

    I changed the phone setting to allow non-Marketplace apps, and this still does not help. There's no log or indication that the deployment failed. Although I see this in the /var/log/system.log:

       Mar  2 10:11:51 clozaril-2 [0x0-0xa25a25].com.appcelerator.titanium.developer[96952]: [15:11:51:841] [Titanium.API] [Information] (JavaScript.KKJSList) [ "/Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android/builder.py", "install", ""KitchenSink"", ""/opt/android-sdk"", ""/Users/cwolf/src/appcelerator-KitchenSink-4d0db58/0.9.x/KitchenSink"", ""com.nolanwright.kitchensink"", ""3"", ]
       

    ...if that means anything.

  6. Chris Wolf 2011-04-15

    I tried to run that builder.py from the command line:

       "/Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android/builder.py" \
        install, KitchenSink, /opt/android-sdk, \
        /Users/cwolf/src/appcelerator-KitchenSink-4d0db58/0.9.x/KitchenSink, \
        com.nolanwright.kitchensink, 3
       

    ...but got the following except stack trace:

       Traceback (most recent call last):
         File "/Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android/builder.py", line 16, in ?
           from android import Android
         File "/Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android/android.py", line 9, in ?
           from mako.template import Template
         File "/Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android/mako/template.py", line 10, in ?
           from mako.lexer import Lexer
         File "/Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android/mako/lexer.py", line 10, in ?
           from mako import parsetree, exceptions
         File "/Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android/mako/parsetree.py", line 9, in ?
           from mako import exceptions, ast, util, filters
         File "/Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android/mako/ast.py", line 9, in ?
           from mako import exceptions, pyparser, util
         File "/Library/Application Support/Titanium/mobilesdk/osx/0.9.3/android/mako/pyparser.py", line 25, in ?
           from compiler import parse as compiler_parse
       ImportError: cannot import name parse
       

    ...but when I tried to run those lines in pyparser.py from the interpreter, everything looked fine:

       $ python
       Python 2.4.4 (#1, Oct 18 2006, 10:34:39) 
       [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
       >>> from compiler import parse as compiler_parse
       >>> from compiler import visitor
       >>> print compiler_parse
       <function parse at 0x76eb0>
       >>>
       

    Any ideas how I can debug this device deployment problem?

  7. Chris Wolf 2011-04-15

    I'm going to try reassigning to Nolan Wright, since it appears he was the original developer of KitchenSink.

  8. Chris Wolf 2011-04-15

    I guess I should have watched the videos first. (I did read the "getting started guide") One of the videos
    points out that in addition to setting "allow installation of non-market apps", you also need
    "usb debug" turned on. This allowed me to install the app. Before I saw this, I tried modifying mobiles.py to add my Motorola Droid's vendor and product code to the device lookup table.
    It turns out not to matter, but I'll attach it anyway since usbprobe returns with zero exit
    status (device was found).

    Feel free to close this ticket. Thanks and sorry for the noise...

  9. Chris Wolf 2011-04-15

    I should add that one of the videos incorrectly states that java-5 (1.5) can be used, but I found that
    java 1.6 is the minimum (at least for Android).

  10. Ping Wang 2012-07-25

    Cannot reproduce.

JSON Source