现在使用的2.0版本,发现cce文件在用快捷组合键时,或者其他情况会导致内容错误。
例如下面的
me.hello.SceneController"/>
然后,我编译的时候不报错,只是启动的时候出现如下错误。让人莫名其妙,我把所有文件都删了,发现还有问题,才看cce文件,发现竟然代码错乱了。
错误2:加了label后,又出错误.这个错误是Label缺少fontSize的定义,如下,我加了定义就消除了——默认图形界面是有参数设置的,但是Text文本没有load进去,所以要手动添加这项。
<Label name="scoreLabel" text="100" positionX="101.0" positionY="96.0" fontSize="10"/>
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ java.lang.ArithmeticException: divide by zero
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at org.cocos2dx.lib.Cocos2dxBitmap.splitString(Cocos2dxBitmap.java:320)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at org.cocos2dx.lib.Cocos2dxBitmap.computeTextProperty(Cocos2dxBitmap.java:246)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at org.cocos2dx.lib.Cocos2dxBitmap.createTextBitmapShadowStroke(Cocos2dxBitmap.java:133)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at org.cocos2dx.lib.Cocos2dxRenderer.nativeRender(Native Method)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at org.cocos2dx.lib.Cocos2dxRenderer.onDrawFrame(Cocos2dxRenderer.java:96)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ java.lang.ArithmeticException: divide by zero
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at org.cocos2dx.lib.Cocos2dxBitmap.splitString(Cocos2dxBitmap.java:320)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at org.cocos2dx.lib.Cocos2dxBitmap.computeTextProperty(Cocos2dxBitmap.java:246)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at org.cocos2dx.lib.Cocos2dxBitmap.createTextBitmapShadowStroke(Cocos2dxBitmap.java:133)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at org.cocos2dx.lib.Cocos2dxRenderer.nativeRender(Native Method)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at org.cocos2dx.lib.Cocos2dxRenderer.onDrawFrame(Cocos2dxRenderer.java:96)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
10-03 17:20:53.604 20619-20650/org.ccj.game.hello W/System.err﹕ at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
错误3:在Activity的线程中运行cocos2d控件时出错。用了UIHandler也无法解决,多线程问题,虽然能获得控件,但似乎Activity和Java多线程访问机制没完善,导致这类问题。
10-03 21:31:23.339 15883-15928/org.ccj.game.hello E/GameActivity﹕ 1
10-03 21:31:23.339 15883-15928/org.ccj.game.hello A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x3f800000 (code=1), thread 15928 (Thread-11335)