Hi,
we have execute this code on the Android build:
cc.resources.load(cc.GAMEDATA.currentWorldPath + '/Background', function(err, prefabs) {
if(err !== null && err !== undefined) {
cc.log(err.message);
cc.log(err.stack);
}
else {
cc.TOOL.currentBackground = cc.instantiate(prefabs);
cc.TOOL.currentBackground.setParent(cc.LAYERS.background);
cc.TOOL.currentBackground.active = true;
cc.TOOL.currentBackground.x = 0;
cc.TOOL.currentBackground.y = 0;
cc.TOOL.currentBackground.__resource = prefabs;
}
});
but when CC try to execute
cc.TOOL.currentBackground = cc.instantiate(prefabs);
we have this error:
2020-12-03 17:37:43.394 10735-10965/com.test.google D/jswrapper: JS: [ERROR]: (see stack) Uncaught TypeError: assemblerCtor is not a constructor [0]get@src/cocos2d-jsb.a980e.js:36003
[1]223.Assembler.init@src/cocos2d-jsb.a980e.js:36075
[2]_resetAssembler@src/cocos2d-jsb.a980e.js:20696
[3]__preload@src/cocos2d-jsb.a980e.js:20701
[4]__preload@src/cocos2d-jsb.a980e.js:22708
[5]anonymous@src/cocos2d-jsb.a980e.js:31524
[6]eval@(no filename):3
[7]anonymous@src/cocos2d-jsb.a980e.js:17259
[8]invoke@src/cocos2d-jsb.a980e.js:28520
[9]activateNode@src/cocos2d-jsb.a980e.js:28618
[10]_onHierarchyChanged@src/cocos2d-jsb.a980e.js:41950
[11]_onHierarchyChanged@src/cocos2d-jsb.a980e.js:8567
[12]setParent@src/cocos2d-jsb.a980e.js:41690
[13]anonymous@assets/main/index.7030a.js:5079 <— this is
cc.TOOL.currentBackground = cc.instantiate(prefabs);
cc.TOOL.currentBackground.setParent(cc.LAYERS.background);
[14]anonymous@src/cocos2d-jsb.a980e.js:35755
[15]fireTimeout@jsb-adapter/jsb-builtin.js:2191
[16]tick@jsb-adapter/jsb-builtin.js:2148
this is on Android. On HTML browser works fine… idea?
Thanks for support!
Stefano