Android Module

You must Login before you can answer or comment on any questions.

hello, I created a module android to use Google Analytics, and when I call the method of tracking I get anerror.here is my code apps.js

var win = Ti.UI.createWindow({
    backgroundColor:'white'
});
win.open();
var bt = Ti.UI.createButton({ title : 'Tracke',     backgroundColor:'yellow' });
// TODO: write your module tests here
var calc = require('calc');
Ti.API.info("module is => " + calc);
 
bt.addEventListener('click',function(e){
    bt.backgroundColor = 'red';
    alert(calc.trackePage("Button", "Click", "tracke"));
});
win.add(bt);
and here is the error
Message: Uncaught Error: Java Exception Occurred
Source: alert(calc.trackePage ("Button", "Click", "tracke"));
and here the error in build.log :
E/TiJSError(  415): (main) [1,263017] - Message: Uncaught Error: Java Exception occurred
E/TiJSError(  415): (main) [0,263017] - Source:     alert(calc.trackePage("Button", "Click", "tracke"));
E/V8Exception(  415): Exception occurred at app.js:28: Uncaught Error: Java Exception occurred
E/JNIUtil (  415): !!! Unable to convert unknown Java object class 'org.appcelerator.kroll.KrollRuntime$1' to Js value !!!
E/JNIUtil (  415): !!! Unable to convert unknown Java object class 'org.appcelerator.kroll.KrollRuntime$1' to Js value !!!
E/JNIUtil (  415): !!! Unable to convert unknown Java object class 'org.appcelerator.kroll.KrollRuntime$1' to Js value !!!
E/JNIUtil (  415): !!! Unable to convert unknown Java object class 'org.appcelerator.kroll.KrollRuntime$1' to Js value !!!
E/JNIUtil (  415): !!! Unable to convert unknown Java object class 'org.appcelerator.kroll.KrollRuntime$1' to Js value !!!
E/JNIUtil (  415): !!! Unable to convert unknown Java object class 'org.appcelerator.kroll.KrollRuntime$1' to Js value !!!
E/JNIUtil (  415): !!! Unable to convert unknown Java object class 'org.appcelerator.kroll.KrollRuntime$1' to Js value !!!
E/JNIUtil (  415): !!! Unable to convert unknown Java object class 'org.appcelerator.kroll.KrollRuntime$1' to Js value !!!
E/JNIUtil (  415): !!! Unable to convert unknown Java object class 'org.appcelerator.kroll.KrollRuntime$1' to Js value !!!

— asked 1 year ago by eddahbani imad
2 Comments
  • and here my calc.trackePage : (Java)

    @Kroll.method
        public String trackePage(String pageView){
            GoogleAnalytics.trackPageViewActivity(pageView);
            return "Page View : " + pageView;
        }
    GoogleAnalytics.trackPageViewActivity :
    public static void trackPageViewActivity(String pageView){
            final String page=pageView.replaceAll("\\[s\\]","");
            tracker.trackPageView(page);
        }

    — commented 1 year ago by eddahbani imad

  • Can you please provide your target environment? That might be helpful at the time to replicate this problem.

    — commented 1 year ago by Eduardo Gomez

Your Answer

Think you can help? Login to answer this question!