Xamarin Android doesn't include exception message in JavaProxyThrowable to Google Play Console

Dan ny 21 Reputation points
2021-03-22T21:34:33.647+00:00

I have a Xamarin Forms Android app on the Google Play store. I've received a few crash reports (Google Console --> Android Vitals --> Crashes and ANR), all of which have type JavaProxyThrowable. As I understand it, this is normal because Xamarin must wrap the C# exception in a Java exception.

However, the exception that's shown only has stack trace information! The original exception type, exception message, and line numbers are lost, making it much more difficult to debug crashes.

How do I get Xamarin to send this information to Google?


More info:

  • I have "Enable Developer Instrumentation (debugging and profiling)" enabled for my release build
  • I'm using the d8 dex compiler and r8 code shrinker. Here are my full settings.
  • Xamarin Forms v5.0.0.2012
  • Cross-posted to Stackoverflow
Developer technologies .NET Xamarin
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JessieZhang-MSFT 7,716 Reputation points Microsoft External Staff
    2021-03-23T04:28:22.107+00:00

    Hello,

    Welcome to our Microsoft Q&A platform!

    Could you please post the full error log about this problem? It should contain clues that are relevant to the problem.

    In addition,, you can also try to use appcenter to trace the error of your app.

    App Center Diagnostics is a cloud service that helps developers monitor the health of an application, delivering the data needed to understand what happens when an app fails during testing or in the wild. The App Center Diagnostics SDK collects information about crashes and errors in your apps and uploads them to the App Center portal for analysis by the development team - eliminating the guesswork about what really happened in the app when it failed.

    For more details, you can check: https://learn.microsoft.com/en-us/appcenter/diagnostics/

    Best Regards,

    Jessie Zhang

    ---
    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Dan ny 21 Reputation points
    2021-03-23T22:30:19.183+00:00

    @JessieZhang-MSFT Here is an example error log from Google Console

    android.runtime.JavaProxyThrowable: at SelectionLogic.QuestionQueue.GetNewIndex (Ringotan.Shared.Kanji.Lessons.KanjiPracticeQuestion question, System.Boolean wasCorrect) [0x0009c] in <4b87953ce6714f2dbf327f2ad7a7bbd2>:0  
    at SelectionLogic.QuestionQueue.MoveCurrentQuestionBackInQueue (System.Boolean wasCorrect) [0x0000c] in <4b87953ce6714f2dbf327f2ad7a7bbd2>:0  
    at SelectionLogic.QuestionQueue.FinishCurrentQuestion (System.Boolean wasCorrect) [0x00014] in <4b87953ce6714f2dbf327f2ad7a7bbd2>:0  
    at SelectionLogic.QuestionSelector.FinishCurrentQuestion (System.Boolean wasCorrect) [0x00066] in <4b87953ce6714f2dbf327f2ad7a7bbd2>:0  
    at Forms.KanjiTestPage.AdvanceQuestion () [0x00032] in <ef5a89a27ec5490d8aa206fc40e34d28>:0  
    at Forms.KanjiTestPage+<>c__DisplayClass17_0.<AdvanceQuestionAfterWait>b__0 () [0x0000d] in <ef5a89a27ec5490d8aa206fc40e34d28>:0  
    at Xamarin.Forms.Forms+AndroidPlatformServices+<>c__DisplayClass24_0.<StartTimer>b__0 () [0x00000] in <2e0d929b7f78480c8db42fc55cca561c>:0  
    at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <a341a74052b84673914f0a36fc09ade5>:0  
    at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <a341a74052b84673914f0a36fc09ade5>:0  
    at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.24(intptr,intptr)  
      at mono.java.lang.RunnableImplementor.n_run (Native Method)  
      at mono.java.lang.RunnableImplementor.run (Unknown Source)  
      at android.os.Handler.handleCallback (Handler.java:883)  
      at android.os.Handler.dispatchMessage (Handler.java:100)  
      at android.os.Looper.loop (Looper.java:224)  
      at android.app.ActivityThread.main (ActivityThread.java:7590)  
      at java.lang.reflect.Method.invoke (Native Method)  
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:539)  
      at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:950)  
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.