-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] Android : Java.Lang.IllegalStateException: Fragment FragmentContainer{7f20e26} (f17e4f2b-a95f-41fd-ade2-368ecc2dd0b4) id=0x2 android:switcher:2:-1519590384} does not have a view #13895
Comments
@jonathanantoine Can you attach a small repro of this crash? I'm not seeing anything in the stack trace that gives me any indication of what might be wrong here |
I'm seeing similar crash reports in appcenter, the app doesn't use the flyout page, and it seems like it's crashing on startup, but I was not able to reproduce it, using xamarin forms 5.0.0.2012
|
@PureWeen XF 4.8 works OK - no crash, app relaunched. Not sure if this is the reason, but JNI-used constructor is missing from FlyoutPageContainer |
@PureWeen @melimion I did some investigation and it appears it works fine with XF 5.0.0.2012 and FlyoutPage. Now I am supsecting one of the latest Xamarin.AndroidX nuget package to be the culprit. Here is my working AndroidX packages versions, updating one of them to the last makes the bug to be here :
@melimion can you tell me if you have one in a higher version than this ? Edit - I am trying to update them one by one to find the culprit(s). Here is the list of excluded one :
I also plainly removed :
|
@jonathanantoine I have all packages updated to latest version. Downgrading to versions that you specified fixed the problem. |
Do you need to reference all those AndroidX packages? Can you just remove them all and just use what transiently comes in with XF? |
@PureWeen yes, it's asked by the Android x migration tools and build failed if not added. If I run the "Migrate to Android X tool" they are all added back so I can't think it's a good idea to remove them. |
I'm seeing this issue after upgrading to the latest packages as well. I upgraded both Xamarin.Forms and all the Xamarin.AndroidX packages, so I'm not sure which of them caused it. I'm using a FlyoutPage, but no tabs. |
If I don't upgrade Xamarin.AndroidX.Fragment and stay to the Version 1.2.5.4, the crash do not seems to happen. |
Can someone attach a small sample project reproducing the issue so that we can investigate further? I've tried and unfortunately have been unable to reproduce the issue myself :/ |
@rachelkang @jonathanantoine
|
Got this issue also randomly with a TabbedPage, no navigation page inside, no flyout. XF 5.0.0.2012 |
@ducmerida can you share which androidX packages you downgraded (fragment I guess ?), but from which version to which version . Cause I don't have a direct reference to fragment, I want to be sure its the one that causes the issue |
We also get this on anything that triggers an activity restart (plugging in a USB keyboard or changing the font size while the app is backgrounded for example). Downgrading the androidx fragment package to 1.2.5.5 solved out issue. |
1.2.5.5 solves the problem any version above this is crashing.
|
I also have the same bug in android I have the latest version of XF:
This is what Google /ARN says any solution??? This is a serious error in production, according to Google/ARN it has occurred in Xiaomi and OnePlus with Android 10 and 11 |
@jsuarezruiz why unverified ? You have a repro project ? |
@jonathanantoine I don't understand. Javier removed the unverified label. I have seen your reproduction and I will get to it, but I haven't had the time yet. Your effort has not been for nothing, don't worry. |
This bug seems to have disappeared in the newest versions, at least for me (but I'm using a FlyoutPage, not a TabPage, so I cannot speak for everybody in here). I'm currently on Xamarin.Forms.5.0.0.2125 and Xamarin.AndroidX.Fragment.1.3.6.3, and haven't seen this crash since I upgraded the NuGet packages 10 days ago. |
Thanks for letting us know @erlenddahl ! I suspect that is the case for most people and there just needs to happen some aggressive cache cleaning, but I would be better safe than sorry so trying to get the bottom of this for everyone :) glad you got it working though! |
@jfversluis sorry I misread the git logs. For my defense I didn't have any news from June which is an eternity when you want to update your app 😥 |
Added Xamarin.AndroidX.Fragment.1.3.6.3 to my Android project in Xamarin Forms solution and still get this issue when I close the app by returning to Android menu, changing either the system display setting or the system font size setting, and then re-opening the application. I ended up downgrading to version 1.2.5.4 and the exception is not happening. |
Downgraded to version 1.2.5.5 solved my issue as well but this is not a good solution to fix it due to not possible to downgrade to this version forever. Please do share if anyone finds a better solution without changing the version. Thanks, |
The same problem on different devices. androidx.fragment.app.FragmentStateManager.createView
|
If anyone could provide a reproduction sample that would help very much! |
Hi @jfversluis,
Here is a repro for another issue which may or may not be related. But it also can be fixed by downgrading to Xamarin.AndroidX.Fragment 1.2.5.5: Basically when using NavigationPage after updating to XF 5.0.0.2083 (or newer) and navigating back without animation(!) previous page content is not restored. |
Hi @jfversluis I suspect the error is occurred when the app is idle/background or lock screen for a long time and open it again from recent app. By using the method above can reproduce the error straight away when you go out from the app and open it again from recent app. You can try with latest version of Xamarin.AndroidX.Fragment instead of version 1.2.5.5. Thanks, |
was this solved in 5.0.0 Service Release 8 from 4 days ago? There is now all spaghetti with XF and AndroidX dependencies |
Using this repo and just running it I have no issue whatsoever if I follow the instructions. Also after adding the latest Forms release it continues to work as expected.
With this repro I see an exception at first, but when I update all the packages to the latest version (AndroidX.Fragment 1.3.6.3 and Forms Service Release 8) it seems to work fine again.
You tell me! :) I've been trying to go through reproductions here and seems fine for me... Love to hear your experience! |
Hi @jfversluis,
Can you please take another look? I have attached screenshots for reference. SR8 still has the issue. |
@jpobst do you have any thoughts on this one maybe? Seems like something broke here between AndroidX.Fragments 1.2.5.5 and the next version. Since reverting to a specific AndroidX version seems to fix it consistently even throughout multiple Forms versions, the root cause might be in the AndroidX packages? |
Seems there is also a bug on this on the AndroidX repo: dotnet/android-libraries#293 I have asked around, unfortunately these libraries are just bindings and don't really add any logic, so the most likely. thing that happened is that there was a change in the AndroidX libraries: https://developer.android.com/jetpack/androidx/releases/fragment |
anyone has update on that issue? |
We have been running with this issue for a month now and today I started to look into it. First, I was able to reproduce the error by minimizing the application and changing a device language via settings then open it back up. It crashed every time with same error: The first thing I did was update the XF itself; from [5.0.0.2012] to [5.0.0.2401]. Issue remains. Then I started digging into the AndroidX.Fragment and tried different versions of it:
On one of the SO answers I found that AndroidX.Activity should be downgraded to 1.2.2 but this still does not help with solving the issue. At the moment none of the workarounds are working for us so it's even a bigger issue. |
@MaTToX3 @jfversluis is there any solution to this problem? |
I had a similar issue, thought it was the same but I am not sure anymore. Anyways updating the AndroidX.Framgment package to 1.5.1 running Xamarin.Forms 5.0.0.2515 worked for me. I also updated the AndroidX.Core packages until I only got warnings about dependencies outside of constraints and no warning about package downgrade. I still had issues with a white screen, but that had something to do with the navigation service, and popping to the root page. |
Is there any fix on this item. Thank you! |
Description
I have a TabbedPage which is using tabs on the bottom. Each page was a MasterDetails page and since I migrated them to Flyout Page I have this exception making my app crash : Java.Lang.IllegalStateException: Fragment FragmentContainer{7f20e26} (f17e4f2b-a95f-41fd-ade2-368ecc2dd0b4) id=0x2 android:switcher:2:-1519590384} does not have a view
Steps to Reproduce
Expected Behavior
The app is displayed.
Actual Behavior
This exception makes the app crash :
Basic Information
Android Support Library / AndroidX Version:
Environment
Show/Hide Visual Studio info
Full exception trace Logs
Reproduction Link
Workaround
None known
The text was updated successfully, but these errors were encountered: