xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.88k forks source link

Navigating back shows blank (white) page when referring to Xamarin.AndroidX.Fragment > v1.2.5.5 #15406

Open npagare opened 2 years ago

npagare commented 2 years ago

Description

In my Xamarin Forms App, when upgrading Xamarin.AndroidX.Fragment above the version 1.2.5.5 results into blank page when navigating back.

Steps to Reproduce

  1. In the Flyoutmaster based (master detail) App build using Prism (8.1.16) navigate to 2 to 3 levels down in the stack.
  2. Navigate back via back button (icon based button)
  3. Previous page shows up as a blank (white) page

Expected Behavior

Navigation should work seamlessly just like in Xamarin.AndroidX.Fragment v 1.2.5.5

Actual Behavior

Navigation returns blank page

Basic Information

Environment

Show/Hide Visual Studio info ``` ```

Build Logs

Screenshots

Reproduction Link

Workaround

npagare commented 2 years ago

Microsoft Visual Studio Professional 2022 (3) Version 17.2.3 VisualStudio.17.Release/17.2.3+32526.322 Microsoft .NET Framework Version 4.8.09032

Installed Version: Professional

Visual C++ 2022 00476-80000-00000-AA900 Microsoft Visual C++ 2022

.NET Core Debugging with WSL 1.0 .NET Core Debugging with WSL

ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools

ASA Service Provider 1.0

ASP.NET and Web Tools 2019 17.2.392.13739 ASP.NET and Web Tools 2019

Azure App Service Tools v3.0.0 17.2.392.13739 Azure App Service Tools v3.0.0

Azure Data Lake Tools for Visual Studio 2.6.5000.0 Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 17.2.392.13739 Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.6.5000.0 Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 4.2.0-4.22252.24+47cdc16a21bbb8a4aadfb666b011e2059e1be5d2 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter 17.0.22089.1 Provides tools for finding, instantiating and customizing templates in cookiecutter format.

DeployToGae Extension 1.0 DeployToGae Visual Studio Extension Detailed Info

Entity Framework Core Power Tools 2.5 Adds useful design-time EF Core DbContext features to the Visual Studio Solution Explorer context menu.

Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Microsoft Azure Hive Query Language Service 2.6.5000.0 Language service for Hive query

Microsoft Azure Stream Analytics Language Service 2.6.5000.0 Language service for Azure Stream Analytics

Microsoft Azure Tools for Visual Studio 2.9 Support for Azure Cloud Services projects

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio 17.2.20 (482eb2a) Support for debugging Mono processes with Visual Studio.

Node.js Tools 1.5.40404.3 Commit Hash:dd524a7d0ee653de8b7b32a93ca22f2d57cd2419 Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 6.2.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Office Developer Tools for Visual Studio 17.0.32314.00 Microsoft Office Developer Tools for Visual Studio

Python - Django support 17.0.22089.1 Provides templates and integration for the Django web framework.

Python - Profiling support 17.0.22089.1 Profiling support for Python projects.

Python with Pylance 17.0.22089.1 Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Razor (ASP.NET Core) 17.0.0.2218101+885a343b00bcab620a90c1550c37dafd730ce984 Provides languages services for ASP.NET Core Razor.

ResX Resource Manager ResXManager Manage localization of all ResX-based resources in one place. Shows all resources of a solution and lets you edit the strings and their localizations in a well-arranged data grid.

SQL Server Data Tools 17.0.62204.01010 Microsoft SQL Server Data Tools

SQLite & SQL Server Compact Toolbox 4.8 SQLite & SQL Server Compact Toolbox adds scripting, import, export, rename, query execution and much more to SQL Server Compact & SQLite Data Connections.

ToolWindowHostedEditor 1.0 Hosting json editor into a tool window

TypeScript Tools 17.0.10418.2001 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.2.0-4.22252.24+47cdc16a21bbb8a4aadfb666b011e2059e1be5d2 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.1.0-beta.22253.3+058e7a7e597a02c129f38742f250a4b212da9ee3 Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio.

VisualStudio.DeviceLog 1.0 Information about my package

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

Workflow Manager Tools 1.0 1.0 This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin 17.2.0.175 (d17-2@e4ffdc0) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 17.2.0.244 (remotes/origin/d17-2@197e1a0b7) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 17.2.15 (2e3b60e) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 12.3.0.3 (d17-2/bbba5a2) Xamarin.Android Reference Assemblies and MSBuild support. Mono: adf1bc4 Java.Interop: xamarin/java.interop/d17-2@9760f0a9 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.38.2@7b1e016 Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-2@fc3c2ac

Xamarin.iOS and Xamarin.Mac SDK 15.10.0.1 (568bdb24e) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

npagare commented 2 years ago

Hello, any thoughts?

npagare commented 2 years ago

Hello @jfversluis, @jsuarezruiz, would appreciate your help.

kvpt commented 2 years ago

I encounter the same issue in one of my app. From the debug log of the FragmentManager all looks fine and no error at all just a blank screen. I have tested a lot of combinaisons of settings to get ride of it, just one fixed the result for my case. The cause in my app was that the push was made with an animation and the pop not, if I use the same animation in the push and the pop the issue disappear.

I tested all the combinations and only one trigger the issue

@IoTFier If the back navigation do not use an animation try to enable it, this is the workaround for me, perhaps it's the same cause for you

kvpt commented 2 years ago

The Xamarin.AndroidX.Fragment being a transitive dependency, the 1.2.5.5 version can be referenced explicitly to force the version. This doesn't seem to cause issue at compilation or runtime. From the changelog here : https://developer.android.com/jetpack/androidx/releases/fragment#1.3.0 The version 1.3 introduce a rewrite of the FragmentManager that can cause the issue, but the strange thing is that there is an api method FragmentManager.EnableNewStateManager that can be used to force the use the previous implementation version (so the 1.2) but it doesn't seem to have an effect and I have the blank page.

I will try to modify some others things but I doesn't see something wrong in the current Xamarin.Forms code, the issue really seems to be in the AndroidX code.

So for now the only good solution is to manually pin the version of the Xamarin.AndroidX.Fragment package to 1.2.5.5.

ahoke-cr commented 1 year ago

I have explicitly referenced AndroidX.Fragment 1.2.5.5 and the issue still reproduces on some Android versions. The page, while rendering all white, can still be interacted with. Opening a non-modal page and then navigating back fixes the white rendering issue.