Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Error on build from source: class file for Function not found

Hi,

when I try to build from source I get

scons: Reading SConscript files ...
java -cp /Users/boenni23/temp/titanium_mobile/android/build/lib/ant.jar:/Users/boenni23/temp/titanium_mobile/android/build/lib/ant-launcher.jar:/Users/boenni23/temp/titanium_mobile/android/build/lib/xercesImpl.jar:/Users/boenni23/temp/titanium_mobile/android/build/lib/xml-apis.jar:/Users/boenni23/temp/titanium_mobile/android/build/lib/ant-nodeps.jar org.apache.tools.ant.launch.Launcher -Dant.home=build -Dandroid.platform=/opt/android-sdk/platforms/android-1.6 -Dbuild.githash=2ed84b -Dandroid.sdk=/opt/android-sdk -Dgoogle.apis=/opt/android-sdk/add-ons/google_apis-4_r02 -Dbuild.version=1.5.0 -buildfile build.xml full.build build.titanium.javadoc
Buildfile: /Users/boenni23/temp/titanium_mobile/android/build.xml

clean.all:

clean:

build.all:
    [javac] Compiling 6 source files to /Users/boenni23/temp/titanium_mobile/android/build/bin
      [jar] Building jar: /Users/boenni23/temp/titanium_mobile/dist/android/ant-tasks.jar

build.kroll.apt:
    [javac] Compiling 4 source files to /Users/boenni23/temp/titanium_mobile/android/kroll-apt/bin
     [copy] Copying 3 files to /Users/boenni23/temp/titanium_mobile/android/kroll-apt/bin

build.kroll.apt.jar:
      [jar] Building jar: /Users/boenni23/temp/titanium_mobile/dist/android/kroll-apt.jar

build.titanium:
    [javac] Compiling 254 source files to /Users/boenni23/temp/titanium_mobile/android/titanium/bin
    [javac] Note: [KrollBindingGen] Running Kroll binding generator.
    [javac] Note: [KrollBindingGen] No binding data found, creating new data file.
    [javac] Note: [KrollBindingGen] Found binding for module Kroll
    [javac] Note: [KrollBindingGen] Found binding for proxy Kroll
    [javac] Note: [KrollBindingGen] Found binding for proxy TiBlob
    [javac] Note: [KrollBindingGen] Found binding for proxy TiFile
    [javac] Note: [KrollBindingGen] Found binding for proxy TiView
    [javac] Note: [KrollBindingGen] Found binding for proxy TiWindow
    [javac] Note: [KrollBindingGen] Found binding for proxy Ti2DMatrix
    [javac] Note: [KrollBindingGen] Found binding for proxy TiAnimation
    [javac] Note: [KrollBindingGen] Found binding for module Titanium
     [copy] Copying 139 files to /Users/boenni23/temp/titanium_mobile/android/titanium/bin
    [javac] Compiling 170 source files to /Users/boenni23/temp/titanium_mobile/android/titanium/bin
    [javac] /Users/boenni23/temp/titanium_mobile/android/titanium/.apt_generated/org/appcelerator/kroll/KrollProxyBindingGen.java:71: cannot access Function
    [javac] class file for Function not found
    [javac]             KrollMethod fireSingleEvent_method = new KrollMethod("fireSingleEvent") {
    [javac]                                                  ^
    [javac] /Users/boenni23/temp/titanium_mobile/android/titanium/.apt_generated/org/appcelerator/kroll/KrollProxyBindingGen.java:112: cannot access BaseFunction
    [javac] class file for BaseFunction not found
    [javac]             bindings.put("fireSingleEvent", fireSingleEvent_method);
    [javac]                     ^
    [javac] /Users/boenni23/temp/titanium_mobile/android/titanium/.apt_generated/org/appcelerator/kroll/KrollProxyBindingGen.java:113: incompatible types
    [javac] found   : org.appcelerator.kroll.KrollMethod
    [javac] required: java.lang.Object
    [javac]             return fireSingleEvent_method;
    [javac]                    ^

BUILD FAILED

Do I have to set some classpath?

— asked November 18th 2010 by Olaf Bährl
  • build failed
  • java
0 Comments

1 Answer

  • Have you successfully compiled before, or has this happened just for the latest commit?

    What OS are you running?

    Have you set the JAVA_HOME directory to the location of sun's java compiler (not open java)? On ubuntu, I have it set to /usr/lib/jvm/java-6-sun-1.6.0.22

    — answered November 18th 2010 by Paul Dowsett
    permalink
    4 Comments
    • I can confirm that I am able to compile without issue with the latest commit.

      — commented November 18th 2010 by Paul Dowsett
    • Hi,

      no I have not compiled successfully. I'm using Mac OS X and JAVA_HOME is set. Maybe I will set up an ubuntu an try it there.
      My experiences with java and macos are still limited.

      Any other ideas?

      — commented November 19th 2010 by Olaf Bährl
    • Hi Olaf

      Do you mind me asking why you want to compile the source? If you just want to run the latest version, why not simply download it from the Continuous Builds page?

      — commented November 19th 2010 by Paul Dowsett
    • Hi,

      in the normal build html5-DB is not enabled for android apps.

      So I want to add the folowing lines to the TiUIWebView:

          settings.setDatabaseEnabled(true);
      
          String databasePath = this.getApplicationContext().getDir("database", MODE_PRIVATE).getPath();
          settings.setDatabasePath(databasePath);
      

      My existing app is already based on the html-db. So I don't want to user the one from titanium.

      — commented November 24th 2010 by Olaf Bährl
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.