Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] App crashes after updating to v4.2.0.709249 #7301

Closed
anpin opened this issue Aug 28, 2019 · 16 comments
Closed

[Bug] App crashes after updating to v4.2.0.709249 #7301

anpin opened this issue Aug 28, 2019 · 16 comments
Assignees
Labels
e/1 🕐 1 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often i/regression p/Android t/bug 🐛
Milestone

Comments

@anpin
Copy link

anpin commented Aug 28, 2019

Description

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#

`

Steps to Reproduce

  1. Update Xamarin.Forms nuget package to v4.2.0.709249
  2. Start an app

Expected Behavior

App starts

Actual Behavior

App crashes

Basic Information

  • Version with issue: v4.2.0.709249 f
  • Last known good version: v4.1.0.709244
  • IDE: Visual Studio 2019 16.2.3
  • Platform Target Frameworks:
    • Android: 28
  • Android Support Library Version: 28.0.0.1
@anpin anpin added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 28, 2019
@anpin
Copy link
Author

anpin commented Aug 28, 2019

someone here is having the same problem

@samhouts
Copy link
Contributor

samhouts commented Aug 28, 2019

@anpin Are you experiencing the same issue as #7283? If not, can you please attach a small project that demonstrates this issue? Thanks!

@samhouts samhouts added i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often p/Android s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Aug 28, 2019
@samhouts samhouts added this to the 4.2.0 milestone Aug 28, 2019
@rs-mobitech
Copy link

Similar to this problem I am experiencing?

#7286

Having to downgrade now. This version is unusable for me

@bentmar
Copy link
Contributor

bentmar commented Aug 29, 2019

I had the exact issue, fixed it by changing my splashactivity from FormsAppCompatActivity to AppCompatActivity

@WilliamWatterson86
Copy link

@bentmar - that seems to work for me too. Is there any side effect of doing this do you think?

@rmarinho
Copy link
Member

@anpin @bentmar can you please provide a small repo so we can investigate further.

Thanks

@pengalo
Copy link

pengalo commented Aug 29, 2019

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

  1. In VS 2019, create new Mobile App (Xamarin.Forms) project
  2. Pick Shell template with all defaults (defaults to Xamarin.Forms 4.1)
  3. Run debug version on device (mine is a Pixel 2)
  4. Click system back button to return to system launcher
  5. App works fine and you can switch back to the app
  6. Upgrade Xamarin.Forms NuGet to latest 4.2
  7. Run again in debug
  8. Click back like before
  9. Now it gets null reference exception

@anpin
Copy link
Author

anpin commented Aug 29, 2019

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

@bentmar
Copy link
Contributor

bentmar commented Aug 30, 2019

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.

@SR84
Copy link
Contributor

SR84 commented Aug 30, 2019

Same here:

at Java.Interop.JniPeerMembers/JniInstanceMethods.InvokeVirtualVoidMethod (string,Java.Interop.IJavaPeerable,Java.Interop.JniArgumentValue*) [0x0005f] in :0
at Android.App.Activity.OnDestroy () [0x00012] in :0
at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnDestroy () [0x00060] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat*FormsAppCompatActivity.cs:228*
at Android.App.Activity.n_OnDestroy (intptr,intptr) [0x0000a] in :0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.24 (intptr,intptr) [0x00011] in :0
at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.24 (intptr,intptr) [0x00033] in :0

Look at FormsAppCompatActivity.cs:228.

@SR84
Copy link
Contributor

SR84 commented Aug 30, 2019

@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

@Phenek
Copy link

Phenek commented Sep 3, 2019

someone here is having the same problem

Yeah I got the same issue as @anpin during my SplashScreen OnDestroy() Activity

@samhouts samhouts removed s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Sep 4, 2019
@DevEddy
Copy link

DevEddy commented Sep 5, 2019

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)

@samhouts
Copy link
Contributor

Probably caused by #6467

@samhouts samhouts added e/1 🕐 1 and removed s/unverified New report that has yet to be verified labels Sep 10, 2019
@alessandrofrancesconi
Copy link

I had the exact issue, fixed it by changing my splashactivity from FormsAppCompatActivity to AppCompatActivity

I've also solved this way

@kingces95 kingces95 mentioned this issue Sep 26, 2019
2 tasks
@kingces95
Copy link
Contributor

#7706 Should fix this. If not, please re-open.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e/1 🕐 1 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often i/regression p/Android t/bug 🐛
Projects
None yet
Development

No branches or pull requests