Uncaught TypeError: Cannot read property ‘k’ of undefined
这是我用官方的lite version版本打包遇到的问题,
build.xml代码如下:
<?xml version="1.0"?><!-- The classpath should be modified to the real closure compiler jar file path -->
<taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask" classpath="./compiler.jar"/>
<target name="compile">
<jscomp compilationLevel="advanced" warning="quiet"
debug="true" output="./game.min.js">
<!-- Uncomment the line below to enable sourcemap generation -->
<!--sourceMapOutputFile="./cocos2d-js-sourcemap" sourceMapFormat="V3"> -->
<sources dir="./">
<!-- You may need to modify the file name to the actual downloaded file name -->
<file name="cocos2d-js-v3.0-lite.js"/>
<file name="start.js"/>
<!-- Put your own js files here, dependency order is also important -->
</sources>
</jscomp>
</target>
start.js
window.onload = function(){
cc.game.onStart = function(){
//load resources
cc.LoaderScene.preload(“HelloWorld.png”], function () {
var MyScene = cc.Scene.extend({
onEnter:function () {
this._super();
var size = cc.director.getWinSize();
var sprite = cc.Sprite.create(“HelloWorld.png”);
sprite.setPosition(size.width / 2, size.height / 2);
sprite.setScale(0.8);
this.addChild(sprite, 0);
var label = cc.LabelTTF.create("Hello World", "Arial", 40);
label.setPosition(size.width / 2, size.height / 2);
this.addChild(label, 1);
}
});
cc.director.runScene(new MyScene());
}, this);
};
cc.game.run("gameCanvas");
};
悲催,这是错在哪儿啊?