模拟器运行加载config.json Unexpected end of JSON input

  • Creator 版本:2.4.0

  • 目标平台: 模拟器

  • 重现方式:运行必现

  • 首个报错:Unexpected end of JSON input Error: Unexpected end of JSON input
    at jsb-adapter/jsb-engine.js:3145:17
    at Object.readFile (jsb-adapter/jsb-engine.js:3116:19)
    at readJson (jsb-adapter/jsb-engine.js:3137:13)
    at parseJson (jsb-adapter/jsb-engine.js:3430:3)
    at download (jsb-adapter/jsb-engine.js:3333:5)
    at downloadJson (jsb-adapter/jsb-engine.js:3442:3)
    at downloadBundle (jsb-adapter/jsb-engine.js:3464:3)
    at invoke (src/cocos2d-jsb.js:21833:15)
    at process (src/cocos2d-jsb.js:21843:15)
    at Object.retry (src/cocos2d-jsb.js:23424:9)

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

  • 编辑器操作系统: win7

  • 重现概率:100%

之前是正常的,然后把ab包大包分包,分出来几十个小包以后,第一次加载config.json必定报错,但是断点断到
readJson: function readJson(filePath, onComplete) {
fsUtils.readFile(filePath, ‘utf8’, function (err, text) {
var out = null;

  if (!err) {
    try {
      out = JSON.parse(text);
    } catch (e) {
      cc.warn('Read json failed: ' + e.message);
      err = new Error(e.message);
    }
  }

  onComplete && onComplete(err, out);
});

},
这里后,跟着断点进去load config.json就不会报错了
如果没有断点跟进去就必定报错