creator 2.1.1 cc.game.restart() 接口调用报错!!!

  • Creator 版本:2.1.1

  • 目标平台: window web

  • 详细报错信息,包含调用堆栈:
    CCMaterial.js:81 Can not set an empty effect asset.
    set @ CCMaterial.js:81
    copy @ CCMaterial.js:130
    getInstantiatedMaterial @ CCMaterial.js:115
    getInstantiatedBuiltinMaterial @ CCMaterial.js:107
    _activateMaterial @ CCSprite.js:496
    onEnable @ CCSprite.js:442
    (anonymous) @ CCClass.js:778
    invokeOnEnable @ component-scheduler.js:307
    invoke @ component-scheduler.js:154
    activateNode @ node-activator.js:228
    _activate @ CCScene.js:111
    runSceneImmediate @ CCDirector.js:466
    (anonymous) @ boot.js:368
    (anonymous) @ CCAssetLibrary.js:246
    (anonymous) @ CCLoader.js:273
    (anonymous) @ utils.js:81
    setTimeout (async)
    callInNextTick @ utils.js:80
    (anonymous) @ CCLoader.js:269
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    flow @ pipeline.js:87
    (anonymous) @ pipeline.js:64
    (anonymous) @ downloader.js:269
    loadCallback @ downloader.js:106
    blend-func.js:76 Uncaught TypeError: Cannot read property ‘getDefaultTechnique’ of null
    at cc_Sprite._updateMaterialBlendFunc (blend-func.js:76)
    at cc_Sprite.setMaterial (blend-func.js:6)
    at cc_Sprite._activateMaterial (CCSprite.js:506)
    at cc_Sprite.onEnable (CCSprite.js:442)
    at cc_Sprite.onEnable (CCClass.js:778)
    at CCClass.invokeOnEnable [as _invoke] (component-scheduler.js:307)
    at CCClass.invoke (component-scheduler.js:154)
    at CCClass.activateNode (node-activator.js:228)
    at cc_Scene._activate (CCScene.js:111)
    at 51.cc.Director.runSceneImmediate (CCDirector.js:466)
    _updateMaterialBlendFunc @ blend-func.js:76
    setMaterial @ blend-func.js:6
    _activateMaterial @ CCSprite.js:506
    onEnable @ CCSprite.js:442
    (anonymous) @ CCClass.js:778
    invokeOnEnable @ component-scheduler.js:307
    invoke @ component-scheduler.js:154
    activateNode @ node-activator.js:228
    _activate @ CCScene.js:111
    runSceneImmediate @ CCDirector.js:466
    (anonymous) @ boot.js:368
    (anonymous) @ CCAssetLibrary.js:246
    (anonymous) @ CCLoader.js:273
    (anonymous) @ utils.js:81
    setTimeout (async)
    callInNextTick @ utils.js:80
    (anonymous) @ CCLoader.js:269
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    flow @ pipeline.js:87
    (anonymous) @ pipeline.js:64
    (anonymous) @ downloader.js:269
    loadCallback @ downloader.js:106
    CCMaterial.js:81 Can not set an empty effect asset.
    set @ CCMaterial.js:81
    copy @ CCMaterial.js:130
    getInstantiatedMaterial @ CCMaterial.js:115
    getInstantiatedBuiltinMaterial @ CCMaterial.js:107
    _activateMaterial @ CCLabel.js:675
    _applyFontTexture @ CCLabel.js:645
    _updateRenderData @ CCLabel.js:700
    onEnable @ CCLabel.js:541
    (anonymous) @ CCClass.js:778
    enableComp @ component-scheduler.js:383
    activateComp @ node-activator.js:325
    addComponent @ base-node.js:971
    generateNode @ CCProfiler.js:147
    beforeUpdate @ CCProfiler.js:170
    214.CallbacksInvoker.invoke @ callbacks-invoker.js:258
    mainLoop @ CCDirector.js:938
    callback @ CCGame.js:641
    requestAnimationFrame (async)
    _runMainLoop @ CCGame.js:645
    resume @ CCGame.js:321
    (anonymous) @ boot.js:370
    runSceneImmediate @ CCDirector.js:458
    (anonymous) @ boot.js:368
    (anonymous) @ CCAssetLibrary.js:246
    (anonymous) @ CCLoader.js:273
    (anonymous) @ utils.js:81
    setTimeout (async)
    callInNextTick @ utils.js:80
    (anonymous) @ CCLoader.js:269
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    (anonymous) @ pipeline.js:67
    (anonymous) @ uuid-loader.js:181
    (anonymous) @ CCLoader.js:316
    157.proto.allComplete @ loading-items.js:529
    157.proto.itemComplete @ loading-items.js:721
    157.LoadingItems.itemComplete @ loading-items.js:379
    160.proto.flowOut @ pipeline.js:319
    flow @ pipeline.js:87
    (anonymous) @ pipeline.js:64
    (anonymous) @ downloader.js:269
    loadCallback @ downloader.js:106
    CCMaterial.js:81 Can not set an empty effect asset.

  • 重现方式:

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

  • 手机型号 :

  • 手机浏览器 :

  • 编辑器操作系统 :

  • 编辑器之前是否有其它报错 :

  • 出现概率:必现;

  • 额外线索:

cocos 还可以 restart?

这个问题已经修复了:
pr: https://github.com/cocos-creator/engine/pull/4479

真皮,这个链接404了

不好意思 链接已经更新

2.0.10也会报错啊。 你这个修复不是2.0.10的