How to debug in Android devices?

Hi.

I´m trying to run a game but it crashes in emulator and device!

All message I can see in Eclipse when trying to run in the emulator is

Thread [<9> GLThread 10] (Suspended (exception IllegalArgumentException))
GLSurfaceView$GLThread.run() line: 1122

Is there a way to get more informations?

I´m using cocos2d-2.1beta3-x-2.1.1.

Thanks

Jose

Has your emulator got GPU emulation enabled?

Check: In Eclipse click Window menu->Android Virtual Device Manager. Click your emulator in the list and click Edit. Under “Hardware Emulation” it needs to have “GPU Emulation”. See the attached image

Hi,

Yes, it´s enabled, but the game crashes in device, also.

How do you get the logs or informations from device?

In Eclipse, you have the Console window and the LogCat window to see what happend.

What device are you running on? What Android SDK build? What Platform (e.g 4.0.3?)? What API level? Are running with “android-ndk-r8d” and the latest SDK? Can you run the Android NDK samples? (like bitmap-plasma).

Is there any way to see the output of the CCLog function when running in device?
It generates a file with the logs?

Jose Marin wrote:

Is there any way to see the output of the CCLog function when running in device?
It generates a file with the logs?

Yes, the LogCat window shows the CCLOG output (click Window-Show View->Logcat).

Jose Marin wrote:

Is there any way to see the output of the CCLog function when running in device?
It generates a file with the logs?

Yes, the LogCat window shows the CCLOG output (click Window-Show View->Logcat).

These are the logs generated in emulator

03-17 22:57:14.089: D/cocos2d-x debug info(325): cocos2d: cocos2d-2.1beta3-x-2.1.1
03-17 22:57:14.759: D/libEGL(325): egl.cfg not found, using default config
03-17 22:57:14.759: D/libEGL(325): loaded /system/lib/egl/libGLES_android.so
03-17 22:57:14.869: W/dalvikvm(325): threadid=9: thread exiting with uncaught exception (group=0x40015560)
03-17 22:57:14.920: E/AndroidRuntime(325): FATAL EXCEPTION: GLThread 10
03-17 22:57:14.920: E/AndroidRuntime(325): java.lang.IllegalArgumentException: No configs match configSpec
03-17 22:57:14.920: E/AndroidRuntime(325): at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:763)
03-17 22:57:14.920: E/AndroidRuntime(325): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:919)
03-17 22:57:14.920: E/AndroidRuntime(325): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1264)
03-17 22:57:14.920: E/AndroidRuntime(325): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)

“Yes, the LogCat window shows the CCLOG output (click Window-Show View->Logcat).”

But only when running in emulator or running in devicer, also?

Jose Marin wrote:

“Yes, the LogCat window shows the CCLOG output (click Window-Show View->Logcat).”
>
But only when running in emulator or running in devicer, also?

Both device and emulator.

Based in the log line “java.lang.IllegalArgumentException: No configs match configSpec” looks like there is something that isn´t correctly configured, but this project was generated by the script “create-android-project.bat”!