Crash on Xamarin.Android not being logged in Raygun
itesup
Posted on
Oct 02 2014
I have an Android app built using the Xamarin framework (Xamarin.Android 4.16.0 Business edition) and with the Raygun4Net component added from Xamarin's component repository. Following the instructions, I initialised the RaygunClient
in my main activity's OnCreate
method:
string raygunApiKey = GetString(Resource.String.RaygunKey); RaygunClient.Attach(raygunApiKey);
Stepping through via debugging, our Raygun API key is correctly being loaded. However, there is a known bug that crashes the application completely when testing it on an Android 2.2 device (API level 8), returning immediately to the home screen. When I check our Raygun.io account, the error isn't listed.
The error is a Java.Lang.ClassNotFoundException, which is caused by attempting to reference the Android.Views.Animations.IInterpolator
interface, which was introduced in API level 11, when instantiating LinearStepInterpolator. The stack trace is as follows:
0x21 in System.Diagnostics.Debugger.Mono_UnhandledException_internal 0x1 in System.Diagnostics.Debugger.Mono_UnhandledException 0x26 in object.8c3fa705-fd9a-4706-aSS6-d2c25044da4e 0x83 in Android.RuntimeJNIEnv.FindClass 0x1 in Android.RuntimeJNIEnv.CreateInstance 0x14 in Android.RuntimeJNIEnv.StartCreateInstance 0x2E in Java.Lang.Object..ctor 0x1 in [AppNamespace].Custom.LinearStepInterpolator..ctor 0xBD in [AppNamespace].WebFragment.OnActivityCreated 0x13 in Android.Support.V4.App.Fragment.n_OnActivityCreated_Landroid_os_Bundle_ 0x17 in object.8c3fa705-fd9a-4706-a556-d2c25D44da4e
I also get the following in the ADB log:
UNHANDLED EXCEPTION: Java.Lang.ClassNotFoundException: Exception of type 'Java.Lang.ClassNotFoundException' was thrown. at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in
Do I need to override into some Android method that handles unhandled exceptions and manually invoke the RaygunClient to log this error? Or is this something that Raygun should be able to handle out-of-the-box? How can I get these 'unhandled' errors sent to Raygun.io?
Many thanks.
Jason Fauchelle
Raygun
Posted on
Oct 28 2014
Thanks for reporting this bug. This issue has been resolved in the latest version of Raygun4Net available from both NuGet and the Xamarin Component store.
-Jason Fauchelle