locked
Error tracing in Xamarin Forms any advice? RRS feed

  • Question

  • User387318 posted

    I feel stupid asking this question, but I’m honestly stumped!

    I’m having a debug dilemma in Visual Studio (Windows version) and wondered if anyone could advise me on the best methods for bug tracing a physical device (Android).

    Currently when running an app, execution terminates with the following error:

    Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: element occurred

    There’s no call stack data (making it impossible to find what method was called before the error occurred) and there’s also no cursor break at the problem area… so the app just crashes out with the above error. Is there any tips, tricks or settings for discovering what’s causing this obscure error?

    Thanks in advance!

    Tuesday, October 22, 2019 7:38 PM

Answers

  • User379860 posted

    First of all, we can open the amarin Diagnostics output verbosity, set the to Diagnostics like following screenshot.

    If you set it, you will see the full stack trace from the VS output windows.

    Then, If you android device connect to the VS, you can open the Logcat, when you app was crashed in the debug mode, you can check the error or exception according to the timeline.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, October 23, 2019 7:31 AM

All replies

  • User387318 posted

    I guess this is one of the Xamarin pitfalls. I forgot to mention that I also have a central error logging mechanism, however, it's never triggered on crash scenarios. When dealing with large projects having time-restrictions, bug tracking Xamarin can be quite annoying at times and is very time consuming.

    Wednesday, October 23, 2019 6:54 AM
  • User379860 posted

    First of all, we can open the amarin Diagnostics output verbosity, set the to Diagnostics like following screenshot.

    If you set it, you will see the full stack trace from the VS output windows.

    Then, If you android device connect to the VS, you can open the Logcat, when you app was crashed in the debug mode, you can check the error or exception according to the timeline.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Wednesday, October 23, 2019 7:31 AM
  • User387318 posted

    Thank you LeonLu, my diagnostics verbosity was set to 'Normal'! Hopefully I'll be able to track down the critter now :smiley:

    Wednesday, October 23, 2019 7:38 AM