Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocos 2D NullPointer Exception

I followed the guide in the following tutorial. http://dan.clarke.name/2011/04/how-to-make-a-simple-android-game-with-cocos2d/

right on the first run i got the following error.

04-29 10:21:08.022: E/AndroidRuntime(12702): FATAL EXCEPTION: GLThread 10
04-29 10:21:08.022: E/AndroidRuntime(12702): java.lang.NullPointerException
04-29 10:21:08.022: E/AndroidRuntime(12702):    at org.cocos2d.nodes.CCAtlasNode.updateBlendFunc(CCAtlasNode.java:168)
04-29 10:21:08.022: E/AndroidRuntime(12702):    at org.cocos2d.nodes.CCAtlasNode.<init>(CCAtlasNode.java:77)
04-29 10:21:08.022: E/AndroidRuntime(12702):    at org.cocos2d.nodes.CCLabelAtlas.<init>(CCLabelAtlas.java:40)
04-29 10:21:08.022: E/AndroidRuntime(12702):    at org.cocos2d.nodes.CCLabelAtlas.label(CCLabelAtlas.java:35)
04-29 10:21:08.022: E/AndroidRuntime(12702):    at org.cocos2d.nodes.CCDirector.setGLDefaultValues(CCDirector.java:593)
04-29 10:21:08.022: E/AndroidRuntime(12702):    at org.cocos2d.nodes.CCDirector.onSurfaceCreated(CCDirector.java:636)
04-29 10:21:08.022: E/AndroidRuntime(12702):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1349)
04-29 10:21:08.022: E/AndroidRuntime(12702):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1119)
like image 432
Vishnu Mohan G Avatar asked Mar 07 '26 19:03

Vishnu Mohan G


1 Answers

That library is no longer updated. It will be better to start using: http://www.cocos2d-x.org/. It uses C++, to work on android, use JNI (Native code). Code can be ported to any other platforms, like IOS.

Hope it will help!

like image 125
vgonisanz Avatar answered Mar 09 '26 08:03

vgonisanz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!