热更新无效,

  • Creator 版本:v2.0.8

问题:热更新完成之后,运行的仍然是老版本

下边是as的日志:

I/zygote: Do partial code cache collection, code=30KB, data=27KB
I/zygote: After code cache collection, code=29KB, data=27KB
Increasing code cache capacity to 128KB
D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@1ad429 file:/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/version.manifest.tmp
D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@5cf44dc file:/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/project.manifest.temp.tmp
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp)
W/com.luosgame.apk: type=1400 audit(0.0:32293): avc: denied { read } for comm=474C5468726561642031333431 name="/" dev=“rootfs” ino=2 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/res/import/0c)
W/com.luosgame.apk: type=1400 audit(0.0:32294): avc: denied { read } for comm=474C5468726561642031333431 name="/" dev=“rootfs” ino=2 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/src)
W/com.luosgame.apk: type=1400 audit(0.0:32295): avc: denied { read } for comm=474C5468726561642031333431 name="/" dev=“rootfs” ino=2 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@4990f47 file:/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/res/import/0c/0caffd9f0.45f3d.json.tmp
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/res/raw-assets/78)
W/com.luosgame.apk: type=1400 audit(0.0:32296): avc: denied { read } for comm=474C5468726561642031333431 name="/" dev=“rootfs” ino=2 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@b1632e0 file:/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/src/settings.14324.jsc.tmp
D/Cocos2dxDownloader: onSuccess(i:200 headers:[Lcz.msebera.android.httpclient.Header;@272a03f file:/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/res/raw-assets/78/78c94f32-4ff7-4fdb-a69d-21d4d011049b.b01ae.manifest.tmp
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp)
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp)
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/res)
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/res/import)
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/res/import/0c)
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/res/raw-assets)
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/res/raw-assets/78)
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp/src)
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset/res)
W/com.luosgame.apk: type=1400 audit(0.0:32297): avc: denied { read } for comm=474C5468726561642031333431 name="/" dev=“rootfs” ino=2 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset/res/import)
W/com.luosgame.apk: type=1400 audit(0.0:32298): avc: denied { read } for comm=474C5468726561642031333431 name="/" dev=“rootfs” ino=2 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset/res/import/0c)
W/com.luosgame.apk: type=1400 audit(0.0:32299): avc: denied { read } for comm=474C5468726561642031333431 name="/" dev=“rootfs” ino=2 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset/res/raw-assets/78)
W/com.luosgame.apk: type=1400 audit(0.0:32301): avc: denied { read } for comm=474C5468726561642031333431 name="/" dev=“rootfs” ino=2 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset/src)
W/com.luosgame.apk: type=1400 audit(0.0:32302): avc: denied { read } for comm=474C5468726561642031333431 name="/" dev=“rootfs” ino=2 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0
D/jswrapper: JS: ["/data/user/0/com.luosgame.apk/files/blackjack-remote-asset/"]
D/jswrapper: ScriptEngine::cleanup begin …
GC begin …, (js->native map) size: 27, all objects: 107
D/jswrapper: GC end …, (js->native map) size: 27, all objects: 107
GC begin …, (js->native map) size: 27, all objects: 107
D/jswrapper: GC end …, (js->native map) size: 27, all objects: 107
D/jswrapper: Destroy WebGLFramebuffer (1) by GC
Destroy WebGLTexture (12) by GC
Destroy WebGLTexture (11) by GC
Destroy WebGLTexture (1) by GC
D/jswrapper: Destroy WebGLTexture (10) by GC
Destroy WebGLTexture (7) by GC
Destroy WebGLTexture (6) by GC
Destroy WebGLTexture (5) by GC
Destroy WebGLTexture (3) by GC
Destroy WebGLTexture (8) by GC
Destroy WebGLBuffer (4) by GC
Destroy WebGLTexture (4) by GC
Destroy WebGLBuffer (5) by GC
D/jswrapper: Destroy WebGLTexture (2) by GC
Destroy WebGLBuffer (3) by GC
Destroy WebGLProgram (3) by GC
Destroy WebGLBuffer (6) by GC
Destroy WebGLTexture (13) by GC
Destroy WebGLTexture (9) by GC
GC begin …, (js->native map) size: 0, all objects: 0
D/jswrapper: GC end …, (js->native map) size: 0, all objects: 0
D/jswrapper: ScriptEngine::cleanup end …
Initializing V8, version: 6.5.254.43
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:6086/00010002-0003-4004-8005-000600070008 ] in chrome browser to debug!
For help see https://nodejs.org/en/docs/inspector
D/jswrapper: JS: Enable batch GL commands optimization!
V/AsyncHttpClient: Beware! Using the fix is insecure, as it doesn’t verify SSL certificates.
D/jswrapper: glGetIntegerv: pname: 0x8b4c
D/jswrapper: JS: Cocos Creator v2.0.8
D/jswrapper: JS: Create unpacker 0caffd9f0 for 2dL3kvpAxJu6GJ7RdqJG5J
D/jswrapper: JS: Create unpacker 062cb7683 for a8Anh32NZGRZegUtSgEj26
D/jswrapper: JS: LoadScene 2dL3kvpAxJu6GJ7RdqJG5J: 106.95900000000006ms
D/jswrapper: JS: Success to load scene: db://assets/Scene/helloworld.fire
V/AsyncHttpClient: Beware! Using the fix is insecure, as it doesn’t verify SSL certificates.
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset)
D/cocos2d-x: find in flash memory dirPath(/data/user/0/com.luosgame.apk/files/blackjack-remote-asset_temp)
W/com.luosgame.apk: type=1400 audit(0.0:32303): avc: denied { read } for comm=474C5468726561642031333431 name="/" dev=“rootfs” ino=2 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0

有许多avc: denied { read }问题是为什么呀?

热更在1.x和2.x都是正常的。
你需要在热更之后重启一下客户端。
cc.game.restart();
在热更测试时,最好是热更前不要打开等待热更的资源,而是热更之后restart之后再打开就是正常的。

有用cc.game.restart();的
/data/user/0/com.luosgame.apk/files/
这个路径能直接看到吗,好像要root权限

是不是我的流程有问题呀?

1、打包apk流程:
a、构建;
b、在main.js中添加代码;
c、热更新,用热更新工具,生成project.manifest,然后放在assets目录下;
d、编译生成apk。

2、热更新资源生成流程:
a、构建;
b、在main.js中添加代码;
c、热更新,用热更新工具,生成project.manifest等资源;
d、将资源放在远程服务器;

这里你少掉了修改热更配置版本的步骤。然后热更包的热更文件也要记得换。另外热更包暂时不要勾选MD5构建。

1赞

关于你说的这个热更新钱不要打开等待热更新的资源是什么意思?
如果打开了会出现什么问题

题主解决没哦。 我也遇到了。