Hello,
I'm trying to create a module for Android and i can't make it work properly. I work on Mac OSX 10.9.1 with Titanium SDK 3.2.0.GA and the titanium studio up to date (3.2.0).
I've created a module named bar with titanium studio. It generates two source files : BarModule.java and ExampleProxy.java
In my main app, i can use var bar = require('com.foo.bar'); bar.createExample();
but if i try to create my own proxy named BazProxy.java, i can't use bar.createBaz()
and i get the following error : Uncaught TypeError: Object #<Bar> has no method 'createBaz'.
If i list the properties of the object bar, createBaz
is not here :
for (prop in bar) { Log.d("Property " + prop); } [INFO] : Property createExample [INFO] : Property addEventListener [INFO] : Property removeEventListener [INFO] : Property fireEvent [INFO] : Property bubbleParent [INFO] : Property invocationAPIs [INFO] : Property _hasJavaListener [INFO] : Property exampleProp [INFO] : Property __propertiesDefined__ [INFO] : Property apiNameWhen i edit the code in the existing method of ExampleProxy.java, i can see the modifications at runtime. When i try to edit ExampleProxy.java to put my own methods and then call
bar.createExample()
i get the following exception about a method i just deleted :[ERROR] : ExampleProxy: Couldn't find proxy method 'getMessage' with signature '()Ljava/lang/String;' [ERROR] : V8Exception: Exception occurred at app.js:109: Uncaught Error: Couldn't find proxy method 'getMessage' with signature '()Ljava/lang/String;' [ERROR] : TiApplication: (KrollRuntimeThread) [252,260] Sending event: exception on thread: KrollRuntimeThread msg:java.lang.NoClassDefFoundError: org/appcelerator/kroll/KrollExceptionHandler$ExceptionMessage; Titanium 3.2.0,2013/12/20 10:57,d9182d6 [ERROR] : TiApplication: java.lang.NoClassDefFoundError: org/appcelerator/kroll/KrollExceptionHandler$ExceptionMessage [ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime.dispatchException(KrollRuntime.java:512) [ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) [ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:159) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289) [ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:185) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:136) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [ERROR] : TiApplication: Caused by: java.lang.NoSuchMethodError: no method with name='getMessage' signature='()Ljava/lang/String;' in class Lfr/jouve/boa/ExampleProxy; [ERROR] : TiApplication: ... 7 more
If i clean the build / bin / libs folders as suggested in this thread (http://developer.appcelerator.com/question/153993/how-to-create-a-proxy#answer-264746), there is no more [INFO] : Property createExample
in the property list.
I think there is a problem with the Kroll annotation processing but i can't find a solution.