After updating to v4.2.0.709249 from v4.1.0.709244 the app is immediately crashing on startup with the following exception
`
0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal C#
0x1 in System.Diagnostics.Debugger.Mono_UnhandledException C#
0x20 in Android.Runtime.DynamicMethodNameCounter.9 C#
0x1 in Xamarin.Forms.Platform.Android.AppCompat.Platform.op_Implicit at D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:491,4 C#
0x3B in Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy at D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:221,4 C#
0xA in Android.App.Activity.n_OnDestroy C#
0x11 in Android.Runtime.DynamicMethodNameCounter.9 C#
`
App starts
App crashes
someone here is having the same problem
@anpin Are you experiencing the same issue as https://github.com/xamarin/Xamarin.Forms/issues/7283? If not, can you please attach a small project that demonstrates this issue? Thanks!
Similar to this problem I am experiencing?
https://github.com/xamarin/Xamarin.Forms/issues/7286
Having to downgrade now. This version is unusable for me
I had the exact issue, fixed it by changing my splashactivity from FormsAppCompatActivity to AppCompatActivity
@bentmar - that seems to work for me too. Is there any side effect of doing this do you think?
@anpin @bentmar can you please provide a small repo so we can investigate further.
Thanks
My issue is similar (related?), but instead of crashing on startup, it crashes when going back to the launcher:
Visual Studio 2019 on Windows 10, Google Pixel 2
App is not crashing with a new blank project with XF v4.2.0.709249, but if I'm adding a splash activity to the app it crashes with the same error right after MainActivity is shown
0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal C#
0x1 in System.Diagnostics.Debugger.Mono_UnhandledException C#
0x20 in Android.Runtime.DynamicMethodNameCounter.9 C#
0x1 in Xamarin.Forms.Platform.Android.AppCompat.Platform.op_Implicit at D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:491,4 C#
0x3B in Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy at D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:221,4 C#
0xA in Android.App.Activity.n_OnDestroy C#
0x11 in Android.Runtime.DynamicMethodNameCounter.9 C#
Sample project with error is in attach
App1.zip
To pinpoint the issue it seems that calling on destroy in a FormsAppCompatActivity gives us a crash in latest XF.
For all of you using splashacitivities use AppCompatActivity instead of the FormsAppCompatActivity.
@WilliamWatterson86 since youre probably not using anything Xamarin.Forms related in your splashactivity there will be no problem with this.
Same here:
at Java.Interop.JniPeerMembers/JniInstanceMethods.InvokeVirtualVoidMethod (string,Java.Interop.IJavaPeerable,Java.Interop.JniArgumentValue) [0x0005f] in
at Android.App.Activity.OnDestroy () [0x00012] in
at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x00060] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat*
at Android.App.Activity.n_OnDestroy (intptr,intptr) [0x0000a] in
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.24 (intptr,intptr) [0x00011] in
at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.24 (intptr,intptr) [0x00033] in
Look at FormsAppCompatActivity.cs:228.
@rmarinho
App is not crashing with a new blank project with XF v4.2.0.709249, but if I'm adding a splash activity to the app it crashes with the same error right after MainActivity is shown
0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal C# 0x1 in System.Diagnostics.Debugger.Mono_UnhandledException C# 0x20 in Android.Runtime.DynamicMethodNameCounter.9 C# 0x1 in Xamarin.Forms.Platform.Android.AppCompat.Platform.op_Implicit at D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:491,4 C# 0x3B in Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy at D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:221,4 C# 0xA in Android.App.Activity.n_OnDestroy C# 0x11 in Android.Runtime.DynamicMethodNameCounter.9 C#
Sample project with error is in attach
App1.zip
someone here is having the same problem
Yeah I got the same issue as @anpin during my SplashScreen OnDestroy() Activity
Same here
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.NullReferenceException: Object reference not set to an instance of an object.
[MonoDroid] at Xamarin.Forms.Platform.Android.AppCompat.Platform.op_Implicit (Xamarin.Forms.Platform.Android.AppCompat.Platform canvas) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:491
[MonoDroid] at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x0002f] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FormsAppCompatActivity.cs:221
[MonoDroid] at Android.App.Activity.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <14fc11fa46a741ab9dde75db7823aece>:0
[MonoDroid] at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.17(intptr,intptr)
Probably caused by https://github.com/xamarin/Xamarin.Forms/pull/6467
I had the exact issue, fixed it by changing my splashactivity from FormsAppCompatActivity to AppCompatActivity
I've also solved this way
Most helpful comment
To pinpoint the issue it seems that calling on destroy in a FormsAppCompatActivity gives us a crash in latest XF.
For all of you using splashacitivities use AppCompatActivity instead of the FormsAppCompatActivity.
@WilliamWatterson86 since youre probably not using anything Xamarin.Forms related in your splashactivity there will be no problem with this.