Xamarin.forms: [Bug] Shell Application crash when clicking hardware back button on android

Created on 30 Aug 2019  路  16Comments  路  Source: xamarin/Xamarin.Forms

Description

Shell Application crash when clicking hardware back button on android (back to device homepage), the error shows System.NullReferenceException, but it occurs on latest Xamarin.Forms (4.2.0.709249) , i test with the version 4.1.0.555618 and no crash happens , i think it's a bug.

Steps to Reproduce

  1. Download official sample :https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/userinterface-xaminals/ .
  2. Upload Xamarin.Forms to the latest .
  3. Test on android, when locates at root page , click hardware back button .

Expected Behavior

Back to HomePage of mobile phone.

Actual Behavior

Crash occurs.

Basic Information

  • IDE: Visual studio 2019 16.1.3
  • Xamarin.Android : 9.3.0.22
  • Nuget Packages: Xamarin.Forms (4.2.0.709249)

Screenshots

33

shell 3 high regression bug

Most helpful comment

I just tried with version 4.2.0.848062 (latest).
Still the same problem with back button.
I have no choice but to go back to 4.1.0.555618.

Do we have a timeline when this will be solved on a released version?

All 16 comments

I'm having the same issue but on 4.1.0.709244

Just adding a tad bit to this. I get "System.NullReferenceException: 'Object reference not set to an instance of an object.'" when using the hardware back button.

Probably already seen something like this but this is the stack trace I'm getting.
image

I'm having the same issue 4.2.0.709249. I tried downgrading to 4.1.0.555618as mentioned by @ColeXm and no issues.

This is a duplicate of #6640.

6715 fixes that.

@PureWeen I wanted to submit a quick fix for this, but looks like @kvpt took a deeper dive.

I was using version 4.2.0.815419 and I was having the same issue.
I downgrade to 4.1.0.555618 as mentioned by @raevenbauto then by @ColeXm and i don't have the issue anymore.

I am still hoping to use the latest version though.
Does it have a fix already?

Same experience as @polieadie & @raevenbauto

I had to downgrade Xamarin.Forms.Maps before Xamarin.Forms in order to downgrade successfully.

4.2.0.815419 --> 4.1.0.555618

I have the same problem.

Xamarin.Forms: 4.2.0.815419

I had to disable the back button so it doesn't go to the home page.

Microsoft, have you reproduced this issue? This is now a blocker for me because the previous versions have a bug with custom shell title (Shell.TitleView) where it obscures the top of the main page content. I can't release with either bug.

I just tried with version 4.2.0.848062 (latest).
Still the same problem with back button.
I have no choice but to go back to 4.1.0.555618.

Do we have a timeline when this will be solved on a released version?

Same here with 4.2.0.709249

... so thought I'd try with 4.3.0.947036 (latest stable) ... same problem still exists

its still a problem in 4.4.0.991265

Can someone provide a basic reproduction, because the reproduction case provided in #6640 seem fixed.

From the stack trace in https://github.com/xamarin/Xamarin.Forms/issues/7327#issuecomment-530214066, the issue seem triggered by the fragment destroy.

In my PR (#6715) I replaced all destroy with dispose, so I'm almost sure that it will fix the issue.
I rebased the changes on top of the 4.4 branch.
If someone can test that, need to rename the zip to nupkg.
Xamarin.Forms.4.4.99.zip

If it works I will resurrect this PR.

I tested this with the latest Xaminals that has XF 4.5 and I'm not seeing a crash anymore

I just tested this now and I still can reproduce the problem with version 4.5.
Going back again to version 4.1.0.555618.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deakjahn picture deakjahn  路  3Comments

EmilAlipiev picture EmilAlipiev  路  3Comments

simontocknell picture simontocknell  路  3Comments

samhouts picture samhouts  路  3Comments

mfeingol picture mfeingol  路  3Comments