Hi everyone,
cocos2d-js 新手一名, 这三天看了各种教程然后down了最新的cocos2djs v3.0 / cocosstudio2.0 然后就入坑了.
现在遇到个问题 自己没法解决:
在使用cocos -compile -p web -m release 打包的时候会提示
Read design size error!
然后看了下源码 断点调试了下 发现 应该是 csLoader.js 里面的
var buffer = PBP"CSParseBinary"]“decode”](binary);
这里面的buffer好像是没有 designwidth designheight这样的属性的,
(ps,这个时候是可以正常运行的)
然后我再使用 --advance 打包,在运行.
会 Uncaught TypeError: Cannot read property ‘CSParseBinary’ of null
然后看了下应该是混淆的时候 导致这个Od 是 null ,然后这个window.dcodeIO应该也是null
var Od;
Od = window.dcodeIO && window.dcodeIO.ProtoBuf ? dcodeIO.ProtoBuf.loadProto("\npackage protocolbuffers;\n\noption optimize_for \x3d LITE_RUNTIME; \n\nmessage CSParseBinary\n{\n optional string version \x3d 1; \n optional string cocos2dVersion \x3d 2;\n\toptional string editorType \x3d 3;\n optional float dataScale \x3d 4;\n optional int32 designHeight \x3d 5;\n optional int32 designWidth \x3d 6; \n repeated string textures \x3d 7;\n
.....................一下省略n多字.
有谁知道这个window.dcodeIO是什么么,这个问题怎么解决呢?
这个问题好像和加载csb有关.