I have a Xamarin.Android application that reports crashes to Raygun. The stack traces reported to Raygun from Release builds do not include line numbers. If I give the Release build configuration the same settings as the Debug configuration in the .csproj file:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
...
</PropertyGroup>
then I still don't see line numbers in the stack traces sent to Raygun. However, if I run the app with the Visual Studio debugger attached, then the stack traces sent to Raygun do include line numbers. Note that all stack traces include class and method names in any case. This question is only concerned with line numbers.
Why do stack traces only include line numbers if the debugger is attached when an exception is thrown? More importantly, how can I get line numbers in the Release build's reported stack traces, without a debugger attached?
You would need to symbolize the "native" Android crash report via
mono-symbolicate
using the symbols of the release build (the build's msym and the build app must be from the same build).Some crash reporting services directly support Xamarin and allow you to upload the build's msym files and automatically run
mono-symbolicate
, others do not and thus require you to do it manually (or some support web-hooks and you can implement it yourself to run on each received crash report, I do it this way on Fabric)mono-symbolicate
)