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

Crash after navigating from one page (with navbar) to another one without navbar #4311

Closed
nevse opened this issue Jan 25, 2022 · 2 comments · Fixed by #5466
Closed

Crash after navigating from one page (with navbar) to another one without navbar #4311

nevse opened this issue Jan 25, 2022 · 2 comments · Fixed by #5466
Labels
area-navigation NavigationPage fixed-in-6.0.300-rc.1 Look for this fix in 6.0.300-rc.1! platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@nevse
Copy link

nevse commented Jan 25, 2022

Description

Project to reproduce https://github.com/nevse/Maui12NavigationwithNavBar. Just click on "Goto page2!" button and application will crush.

I created two pages. One page wrapped in NavigationPage and another is not. And I simply navigate from one page to another on button click

private void OnCounterClicked(object sender, EventArgs e) {
    Application.Current.MainPage = new MainPage2();
}
2022-01-25 18:46:31.057 19951-19951/com.companyname.navpagetest1 E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.companyname.navpagetest1, PID: 19951
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
        at android.view.ViewGroup.addViewInner(ViewGroup.java:5235)
        at android.view.ViewGroup.addView(ViewGroup.java:5064)
        at android.view.ViewGroup.addView(ViewGroup.java:5004)
        at crc64fcf28c0e24b4cc31.ButtonHandler_ButtonClickListener.n_onClick(Native Method)
        at crc64fcf28c0e24b4cc31.ButtonHandler_ButtonClickListener.onClick(ButtonHandler_ButtonClickListener.java:30)
        at android.view.View.performClick(View.java:7448)
        at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
        at android.view.View.performClickInternal(View.java:7425)
        at android.view.View.access$3600(View.java:810)
        at android.view.View$PerformClick.run(View.java:28305)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Steps to Reproduce

  1. run app dotnet build -t:Run -f net6.0-android
  2. click on button "Goto page2!" and application will crush

Version with bug

Preview 12 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11

Did you find any workaround?

No response

Relevant log output

No response

@nevse nevse added the t/bug Something isn't working label Jan 25, 2022
@Phil4121
Copy link

Maybe linked to: #4307

@jsuarezruiz jsuarezruiz added the area-navigation NavigationPage label Jan 25, 2022
@hartez hartez changed the title Crush after navigating from one page (with navbar) to another one without navbar Crash after navigating from one page (with navbar) to another one without navbar Jan 26, 2022
@shimingsg shimingsg added s/verified Verified / Reproducible Issue ready for Engineering Triage platform/android 🤖 labels Feb 16, 2022
@shimingsg
Copy link

shimingsg commented Feb 16, 2022

Verified Repro with Android 11. Repro project
4311.zip

@ghost ghost locked as resolved and limited conversation to collaborators Apr 21, 2022
@samhouts samhouts added the fixed-in-6.0.300-rc.1 Look for this fix in 6.0.300-rc.1! label Feb 17, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-navigation NavigationPage fixed-in-6.0.300-rc.1 Look for this fix in 6.0.300-rc.1! platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
5 participants