Crash Reporting for Cocos2d-x

Crash reporting for Cocos2d-x is complex. You need to have many platforms and deep integration with Android, Win32, Mac, and iOS.

NDK Crash Reporting
http://www.crittercism.com/
http://support.hockeyapp.net/kb/client-integration-android-other-platforms/hockeyapp-for-android-ndk-early-access

Win32
https://code.google.com/p/crashrpt/

Mac OS X
Crashlytics
HockeyApp

iOS
Crashlytics
HockeyApp
Crittercism

Windows Phone
HockeyApp
Crittercism

Those are the platforms I have successfully used. What about you?

3 Likes

I have now moved all of my production applications to HockeyApp for iOS, Mac OS X and Android NDK.

http://support.hockeyapp.net/kb/client-integration-android-other-platforms/hockeyapp-for-android-ndk-early-access

Stack support is fantastic, the API provides easy integration with your build system for automatic uploading of symbol files and integration with bug tracking software for automatic routing and tracking.

Crittercism has raised their prices to several hundred dollars a month and I just couldn’t afford it.

If anyone needs help with HockeyApp, just let me know.

I have yet to worry about such things, thanks for the useful set of links).

I would strongly recommend that you integrate crash reporting before you release.

Without it, your game could tank and you wouldn’t even know why.

Take my word for it, lessons learned the hard way. =)

Thank you! I will definitely try HockeyApp. Truth while I am still to finish my project and trying to get to work the payment system on the second test project, which is why I had to post a test project yesterday. So much new information seems to make me a bit crazy.

Hey,

Could you provide a basic howto on integrating cocos2d-x with HockeyApp?

Regards,
Kid

Using TestinCrash We are using NDK crash reporting and the crashes are being reported in the dashboard. The issue is that since all the NDK crashes have the same digest: “Crash reason: SIGSEGV” even though they are completely different crashes, it gets clubbed under one, and thus it shows only the latest crash. We are unable to view the remaining crashes stacks.

Is there any way of viewing the remaining stack traces?

You need a crash reporting service that can resolve your symbols.

With HockeyApp I upload our .so files with each release and we get line numbers and stuff.

Although it does not provide much information ExceptionHandler does the trick for me, in case anyone is looking for a Windows solution.

Anyone looking for a real world solution on Windows can use this free tookit for gathering crash reports.

http://crashrpt.sourceforge.net/

It is much more sophisticated than ExceptionHandler, catches all the same things and provides a very nice user interface, feedback mechanism and easily extensible server-side utility to collect and symbolicate your stacks.

After a few years of work on this topic, this is still the best way to collect crash reports in production from Win32 users.

Hi Corytrese,

I want to implement Crash Analytics in my cocos2d-x game for Ipad. Can you help, how can I implement it. I tried the documentation given in hockeyapp website, but its not working.

Thanks & Regards,
Gunjan

thank you corytrese for this thread.

I’m trying to install breakpad (required for HockeyApp) as we speak, but I don’t seem to manage to configure my Android.mk very well – compiling fails.

Here is my Android.mk:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../../cocos2d/cocos)
$(call import-add-path,~/Documents/android/Breakpad/android)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

LOCAL_SRC_FILES := hellocpp/main.cpp \
                    ../../../Classes/PRPAppDelegate.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../Classes

# _COCOS_HEADER_ANDROID_BEGIN
# _COCOS_HEADER_ANDROID_END


LOCAL_STATIC_LIBRARIES := cocos2dx_static
LOCAL_STATIC_LIBRARIES += breakpad_client

# _COCOS_LIB_ANDROID_BEGIN
# _COCOS_LIB_ANDROID_END

include $(BUILD_SHARED_LIBRARY)

$(call import-module,.)
$(call import-module,google_breakpad)

# _COCOS_LIB_IMPORT_ANDROID_BEGIN
# _COCOS_LIB_IMPORT_ANDROID_END

Compiling simply stops after all the local cpp files are compiled.
The error I could find was:

/Breakpad/android/google_breakpad/../../src/client/linux/minidump_writer/linux_dumper.cc: In member function 'void google_breakpad::LinuxDumper::ParseLoadedElfProgramHeaders(Elf32_Ehdr*, uintptr_t, uintptr_t*, uintptr_t*, size_t*)':
Breakpad/android/google_breakpad/../../src/client/linux/minidump_writer/linux_dumper.cc:437:30: error: 'UINTPTR_MAX' was not declared in this scope
   const uintptr_t max_addr = UINTPTR_MAX;
                              ^
make: *** [obj/local/armeabi/objs-debug/breakpad_client/src/client/linux/minidump_writer/linux_dumper.o] Error 1

Do you have a working example of an Android.mk with Breakpad?

Found the solution. This fixed it for me:

In case somebody is trying to setup Hockeyapp with breakpad as well, here some help:

If during compilation you run into messages that say “multiple declarations of X”:

In case during compilation breakpad complains about undefined references to UContextReader and/or ThreadInfo:

In case you have copied over NativeCrashManager.java from the sample app given in the Hockeyapp NDK how-to and some imports cannot be resolved, try this file instead:

It uses the Android Asynchronous Http Client which already comes with cocos2d instead.