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

Switching Tabs after resuming from background throws System.NullReferenceException on Android #12498

Closed
Adelzu opened this issue Jan 8, 2023 · 5 comments
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout platform/android 🤖 s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working
Milestone

Comments

@Adelzu
Copy link

Adelzu commented Jan 8, 2023

Description

When using Tabbed shell page in MAUI project using Android. (Pixel 5 Emulator API 33 also reproduce the problem). If you send the app to the background, and open it again. Switching tabs now will cause a System.NullReferenceException.

Steps to Reproduce

  1. Create a new .NET MAUI Project.
  2. Replace the content of AppShell.xaml with the content from the following.
    <TabBar x:Name="TabBar">
        <Tab Title="Tab1" 
             >
            <ShellContent ContentTemplate="{DataTemplate local:MainPage}"/>
        </Tab>
        <Tab Title="Tab2" 
             >
            <ShellContent ContentTemplate="{DataTemplate local:MainPage}"/>
        </Tab>
    </TabBar>
  1. Run the app on an Android (Tested on Pixel 5 Emulator API 33, Samsung S21 Ultra 5G API 33).
  2. Switch tabs to the other one.
  3. Send the app to the background.
  4. Open the app using the drawer icon (Not from running apps).
  5. Switch tabs (Exception is thrown).

Link to public reproduction project repository

https://github.com/Adelzu/DOTNET_MAUI_NULLREFEXCEP

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 13

Did you find any workaround?

No workaround found yet.

Relevant log output

No response

@Adelzu Adelzu added the t/bug Something isn't working label Jan 8, 2023
@needledrag
Copy link

Same thing here on Android API 30

@jsuarezruiz jsuarezruiz added platform/android 🤖 area-controls-shell Shell Navigation, Routes, Tabs, Flyout labels Jan 9, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Jan 9, 2023
@ghost
Copy link

ghost commented Jan 9, 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.

@yasiralijaved
Copy link

yasiralijaved commented Feb 18, 2023

@jsuarezruiz
This is a very critical bug. It makes MAUI almost non-usable. My company is making a POC to compare Flutter, React and Xamarin for an upcoming project and this bug has made us curious about the reliability of future MAUI.

In fact, We are actually stuck here and are unable to proceed further.

@Zhanglirong-Winnie Zhanglirong-Winnie added s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Jul 5, 2023
@ghost
Copy link

ghost commented Jul 5, 2023

Hi @Adelzu. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

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.

@Zhanglirong-Winnie
Copy link

Zhanglirong-Winnie commented Jul 5, 2023

Verified this issue with Visual Studio Enterprise 17.7.0 Preview 2.0. Not repro on android platform with sample project.
https://github.com/Adelzu/DOTNET_MAUI_NULLREFEXCEP
12498

@ghost ghost closed this as completed Jul 13, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 13, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout platform/android 🤖 s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants