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 during navigation with Navigation page #5168

Closed
thaveeshakannangara opened this issue Mar 9, 2022 · 4 comments · Fixed by #5466
Closed

Crash during navigation with Navigation page #5168

thaveeshakannangara opened this issue Mar 9, 2022 · 4 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
Milestone

Comments

@thaveeshakannangara
Copy link

Description

Once reassigning a NavigationPage to Application.Current.MainPage application will crash. This bug is unique to android, I have tested it targetting Windows platform and it works fine. (was not able to test iOS)

Please note i have test the same on Xamarin Forms also, and it works fine in both android, Windows platforms. (was not able to test iOS)

Can reproduce the Issue from this repo -> repo

Tested Environment :

Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.2.0 Preview 1.0

Attached a Screenshot from the issue rasied :

navigation

Steps to Reproduce

  1. Create 3 ContentPages (ex: LoginPage , OTPView, HomeView)
  2. Set the NavigationPage to MainPage in the App.cs class (ex: MainPage = new NavigationPage(new LoginPage()); )
  3. Add a Button in the LoginPage and on the click handler do a Navigation.PushAsync (ex: Application.Current.MainPage.Navigation.PushAsync(new OTPView());)
  4. Add a Button in the OTPView and on the click handler reassign the NavigationPage to Application.Current.MainPage (ex: Application.Current.MainPage = new NavigationPage(new HomeView()); ) (Lets Assume after OTP validate setting the HomeView as the RootPage)
  5. Run the application targeting android and the application crashes.

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 10 - API 29

Did you find any workaround?

Relevant log output

[ForceDarkHelper] updateByCheckExcludeList: pkg: com.companyname.mauiapp6 activity: crc643b7a81c453cc1630.MainActivity@339eb55
[chatty] uid=10262(com.companyname.mauiapp6) identical 2 lines
[ForceDarkHelper] updateByCheckExcludeList: pkg: com.companyname.mauiapp6 activity: crc643b7a81c453cc1630.MainActivity@339eb55
**Java.Lang.IllegalStateException:** 'Loading...'

[nyname.mauiapp] java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethodA called with pending exception java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
[nyname.mauiapp] java_vm_ext.cc:570] (Throwable with no stack trace)
[nyname.mauiapp] java_vm_ext.cc:570]
[nyname.mauiapp] java_vm_ext.cc:570]     in call to CallObjectMethodA
[nyname.mauiapp] java_vm_ext.cc:570]     from void crc64fcf28c0e24b4cc31.ButtonHandler_ButtonClickListener.n_onClick(android.view.View)
**Java.Lang.IllegalStateException:** 'Loading...'
@thaveeshakannangara thaveeshakannangara added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Mar 9, 2022
@Eilon Eilon added the area-navigation NavigationPage label Mar 9, 2022
@jfversluis jfversluis added platform/android 🤖 and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Mar 9, 2022
@J-Swift
Copy link
Contributor

J-Swift commented Mar 9, 2022

I ran into this as well and found that it seems to be an issue when going from a NavigationPage as MainPage to another NavigationPage as MainPage. When I set my initial MainPage to a ContentPage, I was able to set to a NavigationPage afterwards.

@J-Swift
Copy link
Contributor

J-Swift commented Mar 9, 2022

(I'm on p13)

@Amir-Care Amir-Care added the s/triaged Issue has been reviewed label Mar 10, 2022
@Amir-Care
Copy link

Amir-Care commented Mar 10, 2022

Verified repro with Version 17.2.0 Preview 2.0 [32208.484.main] on Android.
Sample project: #5168.zip

image

@Amir-Care Amir-Care added s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/triaged Issue has been reviewed labels Mar 10, 2022
@J-Swift
Copy link
Contributor

J-Swift commented Mar 11, 2022

I think this is probably a duplicate of #4311

@Redth Redth added this to the 6.0.300-rc.2 milestone Mar 21, 2022
@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
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
Development

Successfully merging a pull request may close this issue.

7 participants