2

I have a Xamarin.Forms Android app that runs reliably in debug build but crashes immediately, on startup, in release build.

My dev environment comprises of a Windows 10 PC with Visual Studio 2019, which is USB connected to the Android 9.0 device that I am testing against.

I have attempted to narrow down the cause of the issue by editing the Visual Studio release build configuration, one setting at a time, until it matches the working debug configuration. However, even with the release build config identical to the debug build config, the crash still occurs. Does this mean that Visual Studio is applying some other release build settings, apart from those configurable in the UI?

Is there any way to access diagnostic information from this crash? Any other suggestions how to identify the cause?

I am happy to post more details of the project configuration and development environment, if it helps.

Update: As suggested by several posters, I have retrieved the logcat data for the crash, but I am not sure how to interpret it, or where to go next:

enter image description here

9
  • 1
    You should use Logcat and check what the error is when the application starts. Commented Aug 22, 2019 at 10:20
  • appcenter.ms will allow you to log crash information Commented Aug 22, 2019 at 10:22
  • Have you tried changing linker options? Try with None. Commented Aug 22, 2019 at 11:58
  • @RajeshSonar - yes, I was also hoping that the linker options might be the culprit, but it didn't make any difference. Thanks Commented Aug 22, 2019 at 13:13
  • @BrunoCaceiro - I have updated my question to include the captured log output, but I don't know how to interpret it. Commented Aug 22, 2019 at 13:15

1 Answer 1

3

Check the Device Log. It should contain Unhandled Exception Info for your App. See here: View->Other Windows->Device Log - it is the Logcat's log, just in built-in to VisualStudio window. Tip1: Open it before running your App, and choose your device in top-left. Tip2: Watch the log immediately after the crash (better copy-it, paste into an editor), because it is overwhelmed by messages very quickly.

Sign up to request clarification or add additional context in comments.

3 Comments

Many thanks Alexandr - that's very helpful (and much easier than using ADB). I have updated my question to include a screenshot of the crash data, but I am still not clear what it tells me. Any further advice please?
The exact reason should be right below the "SIGSEGV" error string. Watching at "Cause: null pointer dereference", it looks like you are trying to access a member on an object, that is null.
Thanks again Alexandr. It puzzles me why this happens in release build and not in debug, but I guess I am a little closer to finding the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.