Ceator版本:V2.1.0 rc6
热更新在Android真机上运行,as报错信息:
2018-11-25 11:50:49.089 16131-16148/? D/jswrapper: Initializing V8, version: 6.0.286.52
2018-11-25 11:50:49.548 16131-16148/? D/jswrapper: JS: Enable batch GL commands optimization!
2018-11-25 11:50:49.549 16131-16148/? E/jswrapper: ERROR: Uncaught ReferenceError: cc is not defined, location: main.js:0:0
STACK:
[0]anonymous@main.js:7
我在jsb-default/main.js 加入
// 在 main.js 的开头添加如下代码
if (cc.sys.isNative) {
var hotUpdateSearchPaths = cc.sys.localStorage.getItem(‘HotUpdateSearchPaths’);
if (hotUpdateSearchPaths) {
jsb.fileUtils.setSearchPaths(JSON.parse(hotUpdateSearchPaths));
}
}
进入就黑屏幕,报错内容如上。