热更新完 调用restart 后 黑屏 或者卡死 (必现)3.5版本

  • Creator 版本:3.5

  • 目标平台:安卓

  • 重现方式:安装后热更新完 代码里自动调用了restart函数

  • 首个报错:D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/0c/0ca63e454.json
    2022-05-10 11:23:59.992 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/0b/0bd94635c.json
    2022-05-10 11:23:59.997 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/01/01cb9729-501c-422b-8562-c45f0612db71@f9941.json
    2022-05-10 11:24:00.006 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/f4/f41c05bf-aeac-4a5d-84aa-9c1d075a3b00@f9941.json
    2022-05-10 11:24:00.008 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/e1/e1501f90-4c54-47d7-a414-b4ff70cd9633@f9941.json
    2022-05-10 11:24:00.011 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/84/84c94c61-8098-4d4b-94d4-0fac59efc039@f9941.json
    2022-05-10 11:24:02.008 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/0c/0ca63e454.json
    2022-05-10 11:24:02.019 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/0b/0bd94635c.json
    2022-05-10 11:24:02.031 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/01/01cb9729-501c-422b-8562-c45f0612db71@f9941.json
    2022-05-10 11:24:02.040 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/f4/f41c05bf-aeac-4a5d-84aa-9c1d075a3b00@f9941.json
    2022-05-10 11:24:02.047 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/e1/e1501f90-4c54-47d7-a414-b4ff70cd9633@f9941.json
    2022-05-10 11:24:02.054 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/84/84c94c61-8098-4d4b-94d4-0fac59efc039@f9941.json
    2022-05-10 11:24:04.036 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/0c/0ca63e454.json
    2022-05-10 11:24:04.050 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/0b/0bd94635c.json
    2022-05-10 11:24:04.064 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/01/01cb9729-501c-422b-8562-c45f0612db71@f9941.json
    2022-05-10 11:24:04.075 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/f4/f41c05bf-aeac-4a5d-84aa-9c1d075a3b00@f9941.json
    2022-05-10 11:24:04.083 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/e1/e1501f90-4c54-47d7-a414-b4ff70cd9633@f9941.json
    2022-05-10 11:24:04.092 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/84/84c94c61-8098-4d4b-94d4-0fac59efc039@f9941.json
    2022-05-10 11:24:06.058 16571-16629/com.test.cocos D/jswrapper: JS: [WARN]: Read file failed: path: assets/resources/import/0c/0ca63e454.json
    2022-05-10 11:24:06.064 16571-16629/com.test.cocos D/jswrapper: JS: [ERROR]: Read file failed: path: assets/resources/import/0c/0ca63e454.json Error: Read file failed: path: assets/resources/import/0c/0ca63e454.json
    at Object.readFile (jsb-adapter/jsb-engine.js:1885:13)
    at readJson (jsb-adapter/jsb-engine.js:1915:13)
    at parseJson (jsb-adapter/jsb-engine.js:2394:3)
    at download (jsb-adapter/jsb-engine.js:2280:5)
    at downloadJson (jsb-adapter/jsb-engine.js:2406:3)
    at process (src/cocos-js/instantiated-27914510.js:53477:21)
    at retry (src/cocos-js/instantiated-27914510.js:52654:15)
    at src/cocos-js/instantiated-27914510.js:52663:21
    at fireTimeout (jsb-adapter/jsb-builtin.js:635:19)
    at tick (jsb-adapter/jsb-builtin.js:593:3)

  • 之前哪个版本是正常的:

  • 手机型号: 荣耀

  • 手机浏览器:

  • 编辑器操作系统:安卓11

  • 重现概率: 百分百


可能是目录错了,参考下这个帖子

改了没有用 还是一样的

你检查一下资源路径有没有文件,如果没有的话,看看文件被放到哪里去了,从日志上看应该是路径的问题哈

拜托安排下出个b站的手把手教学吧?热更新方面,这个对于你们天天写哪些无聊的文章实在多了

搞不懂为什么升级要改资源路径 一改所有人做热更新的都要跟着改

确实 我现在被这个搞的好折磨

热更后如果有路径相关的问题,
尝试调用一下以下方法,再重启

        jsb.fileUtils.purgeCachedEntries();