新鲜热乎的热更新问题

  • Creator 版本:v2.0.1

  • 目标平台: android 模拟器

  • 详细报错信息,包含调用堆栈:11/08 17:22:59: Launching hotupdate
    adb push D:\pro_package\hot_update\jsb-link\frameworks\runtime-src\proj.android-studio\app\build\outputs\apk\debug\hotupdate-debug.apk /data/local/tmp/org.cocos2d.helloworld adb shell pm install -t -r “/data/local/tmp/org.cocos2d.helloworld”
    WARNING: linker: libhoudini.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
    pkg: /data/local/tmp/org.cocos2d.helloworld
    Success

$ adb shell am start -n “org.cocos2d.helloworld/org.cocos2dx.javascript.AppActivity” -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet…Waiting for process to come online
Connected to process 2645 on device unknown-google_nexus_4___5_0_0___api_21___768x1280-192.168.189.101:5555
Capturing and displaying logcat messages from application. This behavior can be disabled in the “Logcat output” section of the “Debugger” settings page.
D/jswrapper: libuv version: 1.13.1
D/jswrapper: Debugger listening…, visit [ chrome-devtools://devtools/bundled/inspector.html?v8only=true&ws=0.0.0.0:5086/00010002-0003-4004-8005-000600070008 ] in chrome browser to debug!
D/jswrapper: For help see https://nodejs.org/en/docs/inspector
D/cocos2d-x: cocos2d: fullPathForFilename: No file found at jsb-adapter/jsb-builtin.jsc. Possible missing file.
D/jswrapper: JS: Enable batch GL commands optimization!
D/jswrapper: JS: undefined
E/jswrapper: ERROR: Uncaught TypeError: Cannot read property ‘isNative’ of undefined, location: main.js:0:0
STACK:
[0]anonymous@main.js:194

  • 重现方式:跟着网上学习热更新,所有准备都做好了,用模拟器测试时,main.js报错

  • 之前哪个版本是正常的 :之前没尝试,现在的版本出现的问题

  • 节点树:

首先我是本地搞了个服务器,本以为服务器部分会出问题,没想到在这里翻车了。哦还有这是main.js的代码,官方文档上复制的,我看其他地方也有cc.sys.isNative,不知为什么就他会出错:dizzy_face:

就是这样子,我是新手小白,搞了一下午了都,求救啊!

不用模拟器试试

不能用模拟器测试热更新,构建其他平台测试。

热更新对配置要求很多的。最好全都和发布一样。 我搞了3天才弄好呢。 涉及到多版本更新,CDN缓存什么的还有坑

用真机真机测试一样的错误:cold_sweat: 这就尴尬了

兄弟,能交流下嘛 我真机测试还报一样的错误

官方文档那里没有更新,你可以直接去GitHub仓库那里直接下一个新的范例来参考

if (jsb) {
var hotUpdateSearchPaths = localStorage.getItem(‘HotUpdateSearchPaths’);
if (hotUpdateSearchPaths) {
jsb.fileUtils.setSearchPaths(JSON.parse(hotUpdateSearchPaths));
}
}

en 我正在看范例的代码,有问题再请教