[Resolved]Box2D is not defined

[Resolved]Box2D is not defined
0.0 0


I download Cocos2d-html5 2.2 and copy template to create new game.

I modify cocos2d.js SingleEngineFile:‘src/Cocos2d-html5-v2.2.min.js’ and box2d:true

When debug project show the error “Uncaught ReferenceError: Box2D is not defined”

Who can help me how to solve this problem

Uncaught ReferenceError: Box2D is not defined GameLayer.js:43
cc.Layer.extend.ctor GameLayer.js:43
(anonymous function) Cocos2d-html5-v2.2.min.js:5
d Cocos2d-html5-v2.2.min.js:4
cc.Scene.extend.onEnter GameLayer.js:215
(anonymous function) Cocos2d-html5-v2.2.min.js:5
cc.Director.cc.Class.extend.setNextScene Cocos2d-html5-v2.2.min.js:1281
cc.Director.cc.Class.extend.*drawSceneForWebGL Cocos2d-html5-v2.2.min.js:1274
cc.DisplayLinkDirector.cc.Director.extend.mainLoop Cocos2d-html5-v2.2.min.js:1294


I had solve this problem

replace SingleEngineFile:‘src/Cocos2d-html5-v2.2.min.js’ use engineDir:‘src/libs/cocos2d/’,


why do you modify the min.js file? you should just modify the build.xml file, and build again…


Hi,max xue.
Cocos2d-html5-v2.2.min.js do not include box2d and chipmunk. if you want to use them, you can use it like:


Thanks Xingsen Ma,I have solve the problem