关于java调用js

问下大家,在原生平台使用,比如JAVA调用客户端JS脚本的时候,有没有遇到过这样的问题
例如:

GPSUtil: CallbackJSCode:require(“GpsUtils”).onReceiveLocation();

jswrapper: ScriptEngine::runScript script GpsUtils, buffer is empty!
jswrapper: [ERROR] Failed to invoke require, location: F:/yuepai/hn/trunk/games/henanmj/build/jsb-default/frameworks/cocos2d-x/cocos/scripting/js-bindings/manual/jsb_global.cpp:236
jswrapper: ERROR: Uncaught TypeError: Cannot read property 'onReceiveLocation' of undefined, location: (no filename):0:0

不要用require,直接用全局变量

window里的可以,但是我想不通为啥以前 1.*时代的可以 2.*时代的就不行了

我是不是需要设置什么路径??

顶一下,我也遇到了这样的问题,1.9.x可以,升级到2.0.7报错。跟楼主用的一样的方式

window.GPSUtil = GPSUtil