1

Every now and again my customers RayGun is reporting this stack trace error form the application.

Can't create handler inside thread Thread[Thread-28,10,main] that has not called Looper.prepare()

When I look at the output window, I get the exact same—no line numbers nor any idea of what is causing the crash. Is there a way to identify where the crash is actually happening in the app?

I use devexpress popup control, and it seems to mention a popup requester in the text below, but I'm not familiar with Java so I'm not sure.

Java.Interop.JniEnvironment+InstanceMethods.CallObjectMethod(Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) in <2c45baecf97f47c282b53aca0c40193f> Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualObjectMethod(System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) in <2c45baecf97f47c282b53aca0c40193f> AndroidX.AppCompat.App.AlertDialog+Builder.Create() in Xamarin.Forms.Platform.Android.PopupManager+PopupRequestHelper+DialogBuilder.Create() in <96f652db3e85415fac9127f887d9026d> Xamarin.Forms.Platform.Android.PopupManager+PopupRequestHelper.OnAlertRequested(Xamarin.Forms.Page sender, Xamarin.Forms.Internals.AlertArguments arguments) in <96f652db3e85415fac9127f887d9026d> (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) System.Reflection.RuntimeMethodInfo.Invoke(System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) in <32c9f39281d24ca284bef7a413e9a3f0>

nathan liang
  • 1,000
  • 2
  • 11
  • 22
c-sharp-and-swiftui-devni
  • 3,743
  • 4
  • 39
  • 100
  • I think no Looper.Prepare indicates a call that affects UI was not done from MainThread. But that would cause a crash consistently; not sure how you get a rare crash. First, do you have a [Global Exception Handler](https://stackoverflow.com/questions/39503390/global-exception-handling-in-xamarin-cross-platform)? Second, it seems to be happening when create a popup, so wrap the places (where tell popup to show) in `try .. catch`. To be sure happens on MainThread at a safe time, might also wrap in BeginInvoke: `Device.BeginInvokeOnMainThread(() => { try { ... } catch { ... } });`. – ToolmakerSteve Apr 12 '22 at 22:31
  • Yeah I have a exception handler in my MainAcitivy.cs on the android side. Thats how I was able to get this information in first place from the customer device their in usa am Uk. , I am using rg popups for a select player dialog and obv am using display alert for any prompts after something is finishing updating. Am also using devepxress popup for a content popup as was easier to do some display at the time – c-sharp-and-swiftui-devni Apr 12 '22 at 23:39

0 Answers0