Search code examples
androidcocos2d-android

Android game development with Cocos2d lib


I want to develop game development with Cocos2d . I am following the tutorial http://dan.clarke.name/2011/04/how-to-make-a-simple-android-game-with-cocos2d/ . I added external cocos2d-android.jar file but when i run sample apps then caused following error. please anyone help me.

04-18 13:09:50.783: E/AndroidRuntime(497): FATAL EXCEPTION: main
04-18 13:09:50.783: E/AndroidRuntime(497): java.lang.NoClassDefFoundError: org.cocos2d.opengl.CCGLSurfaceView
04-18 13:09:50.783: E/AndroidRuntime(497):  at com.agv.Cocos2d.CoCos2dActivity.onCreate(CoCos2dActivity.java:24)
04-18 13:09:50.783: E/AndroidRuntime(497):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-18 13:09:50.783: E/AndroidRuntime(497):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-18 13:09:50.783: E/AndroidRuntime(497):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-18 13:09:50.783: E/AndroidRuntime(497):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-18 13:09:50.783: E/AndroidRuntime(497):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-18 13:09:50.783: E/AndroidRuntime(497):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-18 13:09:50.783: E/AndroidRuntime(497):  at android.os.Looper.loop(Looper.java:123)
04-18 13:09:50.783: E/AndroidRuntime(497):  at android.app.ActivityThread.main(ActivityThread.java:4627)
04-18 13:09:50.783: E/AndroidRuntime(497):  at java.lang.reflect.Method.invokeNative(Native Method)
04-18 13:09:50.783: E/AndroidRuntime(497):  at java.lang.reflect.Method.invoke(Method.java:521)
04-18 13:09:50.783: E/AndroidRuntime(497):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-18 13:09:50.783: E/AndroidRuntime(497):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-18 13:09:50.783: E/AndroidRuntime(497):  at dalvik.system.NativeStart.main(Native Method)

Solution

  • NoClassDefFoundError usually means that the library has not being included in the compilation process. Check that you have added all the relevant jar files and that it is in the Build path in eclipse.