I have a Xamarin.Android application that reports crashes to Raygun. The stack traces reported to Raygun from Release builds do not include line numbers. If I give the Relea
You would need to symbolize the "native" Android crash report via mono-symbolicate
using the symbols of the release build (the build's msym and the build app must be from the same build).
Some crash reporting services directly support Xamarin and allow you to upload the build's msym files and automatically run mono-symbolicate
, others do not and thus require you to do it manually (or some support web-hooks and you can implement it yourself to run on each received crash report, I do it this way on Fabric)
mono-symbolicate
Usage: symbolicate [options] <msym dir> <input file>
symbolicate [options] store-symbols <msym dir> [<dir>]+
Available options:
-h, --help Show this help
-q Quiet, warnings are not displayed
-v Verbose, log debug messages
mono-symbolicate
)Next, grab a crash log which an unhandled exception
adb logcat -d > errors.txt
Finally, use mono-symbolicate to convert the errors to contain file and line numbers:
mono-symbolicate path-to-dll-in-.mSYM-directory path-to-errors.txt
For example, given an errors.txt with the contents:
I/MonoDroid( 1545): System.Exception: wow it broke
I/MonoDroid( 1545): at CrashApp.MainActivity+<OnCreate>c__AnonStorey0.<>m__0 (System.Object , System.EventArgs ) [0x00030] in <filename unknown>:0
I/MonoDroid( 1545): at Android.Views.View+IOnClickListenerImplementor.OnClick (Android.Views.View v) [0x00014] in <filename unknown>:0
I/MonoDroid( 1545): at Android.Views.View+IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (IntPtr jnienv, IntPtr native__this, IntPtr native_v) [0x00011] in <filename unknown>:0
I/MonoDroid( 1545): at (wrapper dynamic-method) System.Object:5616285d-461b-4005-a31b-d4637a8cffffdc (intptr,intptr,intptr)
mono-symbolicate will translate the above into:
I/MonoDroid( 1545): System.Exception: wow it broke
I/MonoDroid( 1545): at CrashApp.MainActivity+<OnCreate>c__AnonStorey0.<>m__0 (System.Object , System.EventArgs ) [0x00030] in /Users/dean/Projects/CrashApp/CrashApp/MainActivity.cs:30
I/MonoDroid( 1545): at Android.Views.View+IOnClickListenerImplementor.OnClick (Android.Views.View v) [0x00014] in /Users/dean/Documents/Sandbox/Xamarin/dellismonodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Webkit.WebBackForwardList.cs:68
I/MonoDroid( 1545): at Android.Views.View+IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (IntPtr jnienv, IntPtr native__this, IntPtr native_v) [0x00011] in /Users/dean/Documents/Sandbox/Xamarin/dellismonodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Webkit.WebBackForwardList.cs:23
I/MonoDroid( 1545): at (wrapper dynamic-method) System.Object:5616285d-461b-4005-a31b-d4637a8cffffdc (intptr,intptr,intptr)