I have no idea why is this happening


It would be nice if you have a little bit more info, although you're already saying you don't know why this is happening.
Do you have any code associated to this? Are you able to reproduce it? It looks like these are App Center reports? Is it possible to contact your users and try to find out what is happening?
We'd love to help, but with this we would be searching for a needle in a haystack. Thank you!
Project has too many functionality including twilio voice and last call logging using depedency service and android service both sending data back to xamarin forms using messaging center.
As stacktrace from appcenter doesnt give a clue where to look it as it crashed randomly. I will get back to you with more info.
Thanks for quick response.
@mzaeemkhan Thanks! We'll keep looking for your reply.
From the code the only thing that can be null in UnhookEvents is ShellSection.
What is interesting is the begining of the OnCreateViewmethod.
var shellSection = ShellSection;
if (shellSection == null)
return null;
So if this code is here,it means that under certain circumstances ShellSection can be null.
From the code it doesn't see to be normaly possible the only path which create the renderer also affect the property.
protected virtual IShellObservableFragment GetOrCreateFragmentForTab(ShellSection shellSection)
{
var renderer = ShellContext.CreateShellSectionRenderer(shellSection);
renderer.ShellSection = shellSection;
return renderer;
}
So two possibilities :
Another hint that something is wrong is this ctor :
protected ShellSectionRenderer(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
{
}
This constructor are called by the android side to restore a disposed object, it indicate an issue somewhere with disposing.
It's generally when a renderer is disposed before his view has been detached.
It can be this case here, the android side call this construtor and create a "zombie" instance, then when the view is finally detached, the GC dispose the renderer and crash because in this case ShellSection is null.
App crash randomly on base.OnDestroy() of mainactivity.cs
protected override void OnDestroy()
{
try
{
base.OnDestroy(); <------
}
catch (Exception ex)
{
Crashes.TrackError(ex);
}
}
Here is stacktrace when app crashed while debugging on visual studio.
at
at Java.Interop.NativeMethods:java_interop_jnienv_call_nonvirtual_void_method_a <0x00007>
at InstanceMethods:CallNonvirtualVoidMethod <0x0031b>
at JniInstanceMethods:InvokeVirtualVoidMethod <0x00353>
at Android.App.Activity:OnDestroy <0x000ab>
at Xamarin.Forms.Platform.Android.FormsAppCompatActivity:OnDestroy <0x001d7>
at DialoctApp.Droid.MainActivity:OnDestroy <0x000bb>
at Android.App.Activity:n_OnDestroy <0x000af>
at Android.Runtime.DynamicMethodNameCounter:22 <0x0006-25 19:31:45.089 E/mono-rt (23496): 6ff6e000-70023000 rw-p 00000000 fd:01 458891
Exactly after this error, i get the unhook error on appcenter as shown on my first post.
Steps to create this is error is always difference... It crashes randomly when e,g moving app to background or keep app running for few minutes with screen lock.
I am still looking for exact steps and will get back with more details. Thanks
I'm going to mark this as a duplicate of #6640 because it is the same error message, and that issue has a reproduction project attached. Thanks!
Duplicate of #6640
Most helpful comment
Project has too many functionality including twilio voice and last call logging using depedency service and android service both sending data back to xamarin forms using messaging center.
As stacktrace from appcenter doesnt give a clue where to look it as it crashed randomly. I will get back to you with more info.
Thanks for quick response.