Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes when navigating after the app has been in the background #12553

Open
Martinchr82 opened this issue Jan 10, 2023 · 7 comments
Open
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) platform/android 🤖 s/triaged Issue has been reviewed t/bug Something isn't working
Milestone

Comments

@Martinchr82
Copy link

Martinchr82 commented Jan 10, 2023

Description
App crashes when navigating to another page, after the app has been in the background, on Android in Release.

Steps to Reproduce
Create a new project (.NET MAUI APP) with .NET 7.0
Visual Studio 2022 17.4.3
MSBuild version 17.4.0+18d5aef85 for .NET
image

Add a second page to the project and create a tabBar in AppShell.xaml with the two pages.
image

Open app -> set app in background -> when pressing SecondPage(the second tab) in the tabBar, the app crashes and the splash screen is shown, and we are sent to MainPage.
If the above is done for a second time, then the app crashes again, but this time it does not come to splash screen.
After this, when opening the app again, everything works.

GitHub repo: https://github.com/Martinchr82/ShellBackgroundCrash

It only happens when build for Release.
I am setting it to Release, and running this in Developer PowerShell:
dotnet publish -f:net7.0-android -c:Release /p:AndroidSigningKeyPass=PasswordHere /p:AndroidSigningStorePass=PasswordHere

I have removed the password and the keyStore file from the Github repo.

After building for release, I install com.companyname.shellbackgroundcrash-Signed.apk on my real device, which is a Samsung Galaxy S8, running Android 9

Version with bug
7.0 (current)

Last version that worked well
Unknown/Other

Affected platforms
Android

Affected platform versions
Android 9 and 10 (Has not tried other versions)

Did you find any workaround?
No

Relevant log output
I am getting two different crashes, one for when the app crashes completely and one for when the app is restarted with the splash screen.

image

image

@PureWeen PureWeen added the s/needs-repro Attach a solution or code which reproduces the issue label Jan 10, 2023
@ghost
Copy link

ghost commented Jan 10, 2023

Hi @Martinchr82. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@PureWeen
Copy link
Member

@Martinchr82 so if your app is built in debug mode it doesn't crash?

@Martinchr82
Copy link
Author

@PureWeen That is correct. In debug mode it doesn´t crash.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Jan 10, 2023
@rachelkang rachelkang added platform/android 🤖 area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) s/needs-repro Attach a solution or code which reproduces the issue and removed s/needs-attention Issue has more information and needs another look labels Jan 10, 2023
@ghost
Copy link

ghost commented Jan 10, 2023

Hi @Martinchr82. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Martinchr82
Copy link
Author

@rachelkang I have now updated my initial post with more details and added a GitHub repo, which reproduces the issue
https://github.com/Martinchr82/ShellBackgroundCrash

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels Jan 11, 2023
@jsuarezruiz jsuarezruiz added area-controls-shell Shell Navigation, Routes, Tabs, Flyout and removed s/needs-attention Issue has more information and needs another look labels Jan 11, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Jan 11, 2023
@ghost
Copy link

ghost commented Jan 11, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@samhouts samhouts added the t/bug Something isn't working label Jul 31, 2023
@Zhanglirong-Winnie Zhanglirong-Winnie added the s/triaged Issue has been reviewed label Aug 15, 2023
@gerhartz
Copy link

Will this be fixed in .Net 7?

Seems similar to an issue fixed in .Net 8. #11259

This is a huge change from Xamarin to not allowing the main page to change in the background.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) platform/android 🤖 s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants