Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[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

Open
jonathanantoine opened this issue Feb 28, 2021 · 48 comments
Labels
i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often p/Android t/bug 🐛

Comments

@jonathanantoine
Copy link

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

  1. Use a Tabbed Page as the main page (not shell).
  2. Create some FlyoutPage having a NavigationPage as the details and a ContentPage as the flyout.
  3. Launch the app
  4. Use some other apps (especially memory consuming one)
  5. Launch again your app from the "main icon"

Expected Behavior

The app is displayed.

Actual Behavior

This exception makes the app crash :

Java.Lang.IllegalStateException: Fragment FragmentContainer{7f20e26} (f17e4f2b-a95f-41fd-ade2-368ecc2dd0b4) id=0x2 android:switcher:2:-1519590384} does not have a view

Basic Information

  • Version with issue: at least 5.0.0.1905
  • Last known good version: don't know
  • Platform Target Frameworks:
    • Android: 10.0 : 29
  • Android Support Library / AndroidX Version: (added below in an expendable section)
  • NuGet Packages:
  • Affected Devices: all android devices
Android Support Library / AndroidX Version:
<PackageReference Include="Xamarin.Android.Support.Animated.Vector.Drawable" Version="28.0.0.3" 
<PackageReference Include="Xamarin.Android.Support.Annotations" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.AsyncLayoutInflater" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Collections" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Compat" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.CoordinaterLayout" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Core.UI" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.CursorAdapter" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.CustomTabs" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.CustomView" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.DocumentFile" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Fragment" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Interpolator" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Loader" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.LocalBroadcastManager" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.SlidingPaneLayout" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.SwipeRefreshLayout" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Transition" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.Palette" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.RecyclerView" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.Vector.Drawable" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.VersionedParcelable" Version="28.0.0.3" />
<PackageReference Include="Xamarin.AndroidX.Activity" Version="1.2.0.1" />
<PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.1.0.9" />
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.7" />
<PackageReference Include="Xamarin.AndroidX.AppCompat.Resources" Version="1.1.0.1" />
<PackageReference Include="Xamarin.AndroidX.Arch.Core.Common" Version="2.1.0.8" />
<PackageReference Include="Xamarin.AndroidX.Arch.Core.Runtime" Version="2.1.0.8" />
<PackageReference Include="Xamarin.AndroidX.AsyncLayoutInflater" Version="1.0.0.7" />
<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.3.0.5" />
<PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0.8" />
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.1.0.7" />
<PackageReference Include="Xamarin.AndroidX.CoordinatorLayout" Version="1.1.0.7" />
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.3.2.3" />
<PackageReference Include="Xamarin.AndroidX.CursorAdapter" Version="1.0.0.7" />
<PackageReference Include="Xamarin.AndroidX.CustomView" Version="1.1.0.6" />
<PackageReference Include="Xamarin.AndroidX.DocumentFile" Version="1.0.1.7" />
<PackageReference Include="Xamarin.AndroidX.DrawerLayout" Version="1.1.1.2" />
<PackageReference Include="Xamarin.AndroidX.Fragment" Version="1.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Interpolator" Version="1.0.0.7" />
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.UI" Version="1.0.0.8" />
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.Utils" Version="1.0.0.7" />
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.7" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Common" Version="2.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData" Version="2.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core" Version="2.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Runtime" Version="2.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel" Version="2.3.0.1" />
<PackageReference Include="Xamarin.AndroidX.Loader" Version="1.1.0.7" />
<PackageReference Include="Xamarin.AndroidX.LocalBroadcastManager" Version="1.0.0.7" />
<PackageReference Include="Xamarin.AndroidX.Media" Version="1.2.1.2" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.2.1" />
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.8" />
<PackageReference Include="Xamarin.AndroidX.MultiDex" Version="2.0.1.7" />
<PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.7" />
<PackageReference Include="Xamarin.AndroidX.Print" Version="1.0.0.7" />
<PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.1.0.8" />
<PackageReference Include="Xamarin.AndroidX.SavedState" Version="1.1.0.1" />
<PackageReference Include="Xamarin.AndroidX.SlidingPaneLayout" Version="1.1.0.2" />
<PackageReference Include="Xamarin.AndroidX.SwipeRefreshLayout" Version="1.1.0.2" />
<PackageReference Include="Xamarin.AndroidX.Transition" Version="1.4.0.1" />
<PackageReference Include="Xamarin.AndroidX.VectorDrawable" Version="1.1.0.7" />
<PackageReference Include="Xamarin.AndroidX.VectorDrawable.Animated" Version="1.1.0.7" />
<PackageReference Include="Xamarin.AndroidX.VersionedParcelable" Version="1.1.1.7" />
<PackageReference Include="Xamarin.AndroidX.ViewPager" Version="1.0.0.7" />

Environment

Show/Hide Visual Studio info
=== Visual Studio Community 2019 for Mac ===

Version 8.8.10 (build 2)
Installation UUID: 92feefa5-5500-4af3-9272-b35e1821aefa
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000122

=== Mono Framework MDK ===

Runtime:
	Mono 6.12.0.122 (2020-02/c621c35ffa0) (64-bit)
	Package version: 612000122

=== Roslyn (Language Service) ===

3.8.0-5.20519.18+4c195c3ac1974edcefa76774d7a59a2350ec55fa

=== NuGet ===

Version: 5.8.0.6860

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.103/Sdks
SDK Versions:
	5.0.103
	5.0.102
	5.0.101
	5.0.100
	3.1.406
	3.1.405
	3.1.404
	3.1.403
	3.1.402
	3.1.401
	3.1.302
	3.1.301
	3.1.300
	3.1.202
	3.1.200
	3.1.102
	3.1.101
	3.1.100
	3.0.101
	3.0.100
	2.2.401
	2.2.300
	2.2.106
	2.2.104
	2.2.101
	2.1.505
	2.1.302
	2.1.301
	2.1.4
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	5.0.3
	5.0.2
	5.0.1
	5.0.0
	3.1.12
	3.1.11
	3.1.10
	3.1.9
	3.1.8
	3.1.7
	3.1.6
	3.1.5
	3.1.4
	3.1.2
	3.1.1
	3.1.0
	3.0.1
	3.0.0
	2.2.6
	2.2.5
	2.2.4
	2.2.2
	2.2.0
	2.1.23
	2.1.22
	2.1.21
	2.1.20
	2.1.19
	2.1.18
	2.1.17
	2.1.16
	2.1.15
	2.1.14
	2.1.13
	2.1.9
	2.1.2
	2.1.1
	2.0.5

=== .NET Core 3.1 SDK ===

SDK: 3.1.406

=== Xamarin.Profiler ===

Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.4 (17801)
Build 12D4e

=== Xamarin.Mac ===

Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

=== Xamarin.iOS ===

Version: 14.10.0.4 (Visual Studio Community)
Hash: 5a05865f6
Branch: xcode12.4
Build date: 2021-01-28 02:30:23-0500

=== Xamarin Designer ===

Version: 16.8.0.510
Hash: 44e3f3ce9
Branch: remotes/origin/d16-8
Build date: 2020-12-10 00:06:14 UTC

=== Xamarin.Android ===

Version: 11.1.0.26 (Visual Studio Community)
Commit: xamarin-android/d16-8/a36ce73
Android SDK: /Users/jonathanantoine/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.4 (API level 19)
		8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 31.0.0
SDK Build Tools Version: 30.0.2

Build Information: 
Mono: 5e9cb6d
Java.Interop: xamarin/java.interop/d16-8@79d9533
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/jonathanantoine/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.8.0.32
Hash: 01a7774
Branch: remotes/origin/d16-8
Build date: 2021-01-14 00:34:58 UTC

=== Android Device Manager ===

Version: 16.8.0.46
Hash: 0a81419
Branch: remotes/origin/d16-8
Build date: 2021-01-14 00:35:22 UTC

=== Build Information ===

Release ID: 808100002
Git revision: f81ffa2444a28c09f173849935ec9ee0195a5b17
Build date: 2021-02-18 12:02:12-05
Build branch: release-8.8
Xamarin extensions: f81ffa2444a28c09f173849935ec9ee0195a5b17

=== Operating System ===

Mac OS X 10.16.0
Darwin 20.3.0 Darwin Kernel Version 20.3.0
    Thu Jan 21 00:07:06 PST 2021
    root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64


Full exception trace Logs

JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args)
Java.Interop
JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters)
Android.App
Activity.OnStart ()
Xamarin.Forms.Platform.Android
FormsAppCompatActivity.OnStart ()
Android.App
Activity.n_OnStart (System.IntPtr jnienv, System.IntPtr native__this)
(wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.14(intptr,intptr)
java.lang.IllegalStateException: Fragment FragmentContainer{97f02ca} (34116daa-5635-4f54-b760-e0190e104a2b) id=0x2 android:switcher:2:-1582031703} does not have a view
androidx.fragment.app.Fragment$4.onFindViewById(Unknown Source:37)
androidx.fragment.app.FragmentStateManager.createView(Unknown Source:73)
androidx.fragment.app.FragmentStateManager.moveToExpectedState(Unknown Source:135)
androidx.fragment.app.FragmentStore.moveToExpectedState(Unknown Source:30)
androidx.fragment.app.FragmentManager.moveToState(Unknown Source:32)
androidx.fragment.app.FragmentManager.dispatchStateChange(Unknown Source:9)
androidx.fragment.app.FragmentManager.dispatchActivityCreated(Unknown Source:11)
androidx.fragment.app.Fragment.performActivityCreated(Unknown Source:23)
androidx.fragment.app.FragmentStateManager.activityCreated(Unknown Source:35)
androidx.fragment.app.FragmentStateManager.moveToExpectedState(Unknown Source:128)
androidx.fragment.app.FragmentStore.moveToExpectedState(Unknown Source:30)
androidx.fragment.app.FragmentManager.moveToState(Unknown Source:32)
androidx.fragment.app.FragmentManager.dispatchStateChange(Unknown Source:9)
androidx.fragment.app.FragmentManager.dispatchActivityCreated(Unknown Source:11)
androidx.fragment.app.FragmentController.dispatchActivityCreated(Unknown Source:4)
androidx.fragment.app.FragmentActivity.onStart(Unknown Source:15)
androidx.appcompat.app.AppCompatActivity.onStart(Unknown Source:0)
crc643f46942d9dd1fff9.FormsAppCompatActivity.n_onStart(Native Method)
crc643f46942d9dd1fff9.FormsAppCompatActivity.onStart(Unknown Source:0)
android.app.Instrumentation.callActivityOnStart Instrumentation.java:1436
android.app.Activity.performStart Activity.java:8124
android.app.ActivityThread.handleStartActivity ActivityThread.java:3527
android.app.servertransaction.TransactionExecutor.performLifecycleSequence TransactionExecutor.java:221
android.app.servertransaction.TransactionExecutor.cycleToPath TransactionExecutor.java:201
android.app.servertransaction.TransactionExecutor.executeLifecycleState TransactionExecutor.java:173
android.app.servertransaction.TransactionExecutor.execute TransactionExecutor.java:97
android.app.ActivityThread$H.handleMessage ActivityThread.java:2108
android.os.Handler.dispatchMessage Handler.java:106
android.os.Looper.loop Looper.java:236
android.app.ActivityThread.main ActivityThread.java:7876
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:656
com.android.internal.os.ZygoteInit.main ZygoteInit.java:967

Reproduction Link

Workaround

None known

@jonathanantoine jonathanantoine added s/unverified New report that has yet to be verified t/bug 🐛 labels Feb 28, 2021
@PureWeen
Copy link
Contributor

PureWeen commented Mar 2, 2021

@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

@PureWeen PureWeen added s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Mar 2, 2021
@stepkillah
Copy link

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

JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args)
JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters)
Activity.OnStart ()
FormsAppCompatActivity.OnStart ()
Activity.n_OnStart (System.IntPtr jnienv, System.IntPtr native__this)
(wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.13(intptr,intptr)
java.lang.IllegalStateException: Fragment FragmentContainer{377ee6f} (404d2e67-b3c9-4ab7-9a6b-56fccf4c8521) id=0x4} does not have a view
androidx.fragment.app.Fragment$4.onFindViewById(Unknown Source:37)
androidx.fragment.app.FragmentStateManager.createView(Unknown Source:73)
androidx.fragment.app.FragmentStateManager.moveToExpectedState(Unknown Source:135)
androidx.fragment.app.FragmentStore.moveToExpectedState(Unknown Source:30)
androidx.fragment.app.FragmentManager.moveToState(Unknown Source:32)
androidx.fragment.app.FragmentManager.dispatchStateChange(Unknown Source:9)
androidx.fragment.app.FragmentManager.dispatchActivityCreated(Unknown Source:11)
androidx.fragment.app.Fragment.performActivityCreated(Unknown Source:23)
androidx.fragment.app.FragmentStateManager.activityCreated(Unknown Source:35)
androidx.fragment.app.FragmentStateManager.moveToExpectedState(Unknown Source:128)
androidx.fragment.app.FragmentStore.moveToExpectedState(Unknown Source:30)
androidx.fragment.app.FragmentManager.moveToState(Unknown Source:32)
androidx.fragment.app.FragmentManager.dispatchStateChange(Unknown Source:9)
androidx.fragment.app.FragmentManager.dispatchActivityCreated(Unknown Source:11)
androidx.fragment.app.FragmentController.dispatchActivityCreated(Unknown Source:4)
androidx.fragment.app.FragmentActivity.onStart(Unknown Source:15)
androidx.appcompat.app.AppCompatActivity.onStart(Unknown Source:0)
crc643f46942d9dd1fff9.FormsAppCompatActivity.n_onStart(Native Method)
crc643f46942d9dd1fff9.FormsAppCompatActivity.onStart(Unknown Source:0)
android.app.Instrumentation.callActivityOnStart Instrumentation.java:1432
android.app.Activity.performStart Activity.java:7825
android.app.ActivityThread.handleStartActivity ActivityThread.java:3322
android.app.servertransaction.TransactionExecutor.performLifecycleSequence TransactionExecutor.java:221
android.app.servertransaction.TransactionExecutor.cycleToPath TransactionExecutor.java:201
android.app.servertransaction.TransactionExecutor.executeLifecycleState TransactionExecutor.java:173
android.app.servertransaction.TransactionExecutor.execute TransactionExecutor.java:97
android.app.ActivityThread$H.handleMessage ActivityThread.java:2041
android.os.Handler.dispatchMessage Handler.java:107
android.os.Looper.loop Looper.java:214
android.app.ActivityThread.main ActivityThread.java:7389
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:492
com.android.internal.os.ZygoteInit.main ZygoteInit.java:980

@melimion
Copy link
Contributor

melimion commented Mar 3, 2021

@PureWeen
Crash reproduces after changing font size in OS settings and switching back to the app.

XF 4.8 works OK - no crash, app relaunched.
XF 5.0 crashes

Not sure if this is the reason, but JNI-used constructor is missing from FlyoutPageContainer

@jonathanantoine
Copy link
Author

jonathanantoine commented Mar 3, 2021

@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.
I am now upgrading them one by one to detect which one is causing the issue.

Here is my working AndroidX packages versions, updating one of them to the last makes the bug to be here :

<PackageReference Include="Xamarin.AndroidX.Fragment" Version="1.2.5.4"/>

@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 :

<PackageReference Include="Xamarin.AndroidX.Interpolator" Version="1.0.0.6"/>
<PackageReference Include="Xamarin.AndroidX.CursorAdapter" Version="1.0.0.6"/>
<PackageReference Include="Xamarin.AndroidX.CustomView" Version="1.1.0.4"/>
<PackageReference Include="Xamarin.AndroidX.AsyncLayoutInflater" Version="1.0.0.6"/>
<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.3.0.4"/>
<PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0.6"/>
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.1.0.6"/>
<PackageReference Include="Xamarin.AndroidX.CoordinatorLayout" Version="1.1.0.6"/>
<PackageReference Include="Xamarin.AndroidX.MultiDex" Version="2.0.1.6"/>
<PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.6"/>
<PackageReference Include="Xamarin.AndroidX.SlidingPaneLayout" Version="1.1.0.1"/>
<PackageReference Include="Xamarin.AndroidX.Print" Version="1.0.0.6"/>
<PackageReference Include="Xamarin.AndroidX.VectorDrawable" Version="1.1.0.6"/>
<PackageReference Include="Xamarin.AndroidX.VectorDrawable.Animated" Version="1.1.0.6"/>
<PackageReference Include="Xamarin.AndroidX.SwipeRefreshLayout" Version="1.1.0.1"/>
<PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.1.0.8"/>
<PackageReference Include="Xamarin.AndroidX.DocumentFile" Version="1.0.1.6"/>
<PackageReference Include="Xamarin.AndroidX.DrawerLayout" Version="1.1.1.1"/>
<PackageReference Include="Xamarin.AndroidX.Loader" Version="1.1.0.6"/>
<PackageReference Include="Xamarin.AndroidX.LocalBroadcastManager" Version="1.0.0.6"/>
<PackageReference Include="Xamarin.AndroidX.Media" Version="1.2.1.1"/>
<PackageReference Include="Xamarin.AndroidX.SavedState" Version="1.0.0.2"/>
<PackageReference Include="Xamarin.AndroidX.ExifInterface"  Version="1.3.2.1"/>
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.UI" Version="1.0.0.7"/>
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.Core.Utils" Version="1.0.0.6"/>
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.6"/>
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.6"/>
<PackageReference Include="Xamarin.AndroidX.ViewPager" Version="1.0.0.6"/>
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Runtime" Version="2.2.0.4"/>
<PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel" Version="2.2.0.4"/>
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.8"/>
<PackageReference Include="Xamarin.AndroidX.VersionedParcelable" Version="1.1.1.6"/>
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.3.2.1"/>
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0.1"/>
<PackageReference Include="Xamarin.AndroidX.AppCompat.Resources" Version="1.1.0.1"/>
<PackageReference Include="Xamarin.AndroidX.Activity" Version="1.1.0.5"/>

I also plainly removed :

<PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.1.0.6"/>
<PackageReference Include="Xamarin.AndroidX.Lifecycle.Common" Version="2.2.0.4"/>
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData" Version="2.2.0.4"/>
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core" Version="2.2.0.4"/>
<PackageReference Include="Xamarin.AndroidX.Transition" Version="1.3.1.6"/>
<PackageReference Include="Xamarin.AndroidX.Arch.Core.Common" Version="2.1.0.7"/>
<PackageReference Include="Xamarin.AndroidX.Arch.Core.Runtime" Version="2.1.0.7"/>

@Redth Redth removed s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Mar 4, 2021
@melimion
Copy link
Contributor

melimion commented Mar 4, 2021

@jonathanantoine I have all packages updated to latest version.

Downgrading to versions that you specified fixed the problem.

@PureWeen
Copy link
Contributor

PureWeen commented Mar 5, 2021

Do you need to reference all those AndroidX packages? Can you just remove them all and just use what transiently comes in with XF?

@jonathanantoine
Copy link
Author

jonathanantoine commented Mar 5, 2021

@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.

@erlenddahl
Copy link

erlenddahl commented Mar 6, 2021

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.

@jonathanantoine
Copy link
Author

If I don't upgrade Xamarin.AndroidX.Fragment and stay to the Version 1.2.5.4, the crash do not seems to happen.
I think we have our culprit.

@rachelkang
Copy link
Contributor

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 rachelkang added s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often p/Android labels Mar 18, 2021
@Jakar510
Copy link

Jakar510 commented Mar 19, 2021

If I don't upgrade Xamarin.AndroidX.Fragment and stay to the Version 1.2.5.4, the crash do not seems to happen.
I think we have our culprit.

@rachelkang @jonathanantoine
I'm still getting the crashes in 1.2.5.4. Note: I'm using Shell. There are other issues found with this package as well: #13843

**System.TypeLoadException:** 'VTable setup of type Jakar.SettingsView.Droid.SettingsViewLayoutManager failed'

03-19 09:49:59.396  JNI DETECTED ERROR IN APPLICATION: JNI NewString called with pending exception android.runtime.JavaProxyThrowable: System.TypeLoadException: VTable setup of type Jakar.SettingsView.Droid.SettingsViewLayoutManager failed
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000cb] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:241 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00033] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:131 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:358 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000b3] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00163] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:481 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000e8] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:244 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00033] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:131 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:358 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000b3] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00163] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:481 
03-19 09:49:59.396    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000e8] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:244 
03-19 09:49:59.397    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00033] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:131 
03-19 09:49:59.397    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Content.Context context) [0x0003e] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:358 
03-19 09:49:59.397    at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x000b3] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:140 
03-19 09:49:59.397    at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00163] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:351 
03-19 09:49:59.397    at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:112 
03-19 09:49:59.397    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:481 
03-19 09:49:59.397    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000e8] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:244 
03-19 09:49:59.397    at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00033] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:131 
03-19 09:49:59.397    at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, AndroidX.Fragment.App.FragmentManager fragmentManager, Android.Content.Context context) [0x00031] in D:\a\1\s\Xamarin.Forms.Platform.Android\Platform.cs:404 
03-19 09:49:59.397    at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState) [0x00008] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:57 
03-19 09:49:59.397    at Xamarin.Forms.Platform.Android.AppCompat.ShellFragmentContainer.OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState) [0x00011] in D:\a\1\s\Xamarin.Forms.Platform.Android\AppCompat\ShellFragmentContainer.cs:35 
03-19 09:49:59.397    at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_inflater, System.IntPtr native_container, System.IntPtr native_savedInstanceState) [0x00021] in D:\a\1\s\generated\androidx.fragment.fragment\obj\Release\monoandroid90\generated\src\AndroidX.Fragment.App.Fragment.cs:1950 
03-19 09:49:59.397    at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.81(intptr,intptr,intptr,intptr,intptr)
03-19 09:49:59.397    at android.view.View crc64720bb2db43a66fe9.ShellFragmentContainer.n_onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) (ShellFragmentContainer.java:-2)
03-19 09:49:59.397    at android.view.View crc64720bb2db43a66fe9.ShellFragmentContainer.onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) (ShellFragmentContainer.java:39)
03-19 09:49:59.397    at void androidx.fragment.app.Fragment.performCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) (Fragment.java:2699)
03-19 09:49:59.397    at void androidx.fragment.app.FragmentStateManager.createView(androidx.fragment.app.FragmentContainer) (FragmentStateManager.java:320)
03-19 09:49:59.397    at void androidx.fragment.app.FragmentManager.moveToState(androidx.fragment.app.Fragment, int) (FragmentManager.java:1199)
03-19 09:49:59.397    at void androidx.fragment.app.FragmentManager.moveToState(androidx.fragment.app.Fragment) (FragmentManager.java:1368)
03-19 09:49:59.397    at void androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(androidx.fragment.app.Fragment) (FragmentManager.java:1446)
03-19 09:49:59.397    at void androidx.fragment.app.BackStackRecord.executeOps() (BackStackRecord.java:442)
03-19 09:49:59.397    at void androidx.fragment.app.FragmentManager.executeOps(java.util.ArrayList, java.util.ArrayList, int, int) (FragmentManager.java:2181)
03-19 09:49:59.397    at void androidx.fragment.app.FragmentManager.executeOpsTogether(java.util.ArrayList, java.util.ArrayList, int, int) (FragmentManager.java:2004)
03-19 09:49:59.397    at void androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(java.util.ArrayList, java.util.ArrayList) (FragmentManager.java:1959)
03-19 09:49:59.397    at void androidx.fragment.app.FragmentManager.execSingleAction(androidx.fragment.app.FragmentManager$OpGenerator, boolean) (FragmentManager.java:1830)
03-19 09:49:59.397    at void androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss() (BackStackRecord.java:303)
03-19 09:49:59.397    at void androidx.fragment.app.FragmentPagerAdapter.finishUpdate(android.view.ViewGroup) (FragmentPagerAdapter.java:246)
03-19 09:49:59.397    at void androidx.viewpager.widget.ViewPager.populate(int) (ViewPager.java:1244)
03-19 09:49:59.397    at void androidx.viewpager.widget.ViewPager.populate() (ViewPager.java:1092)
03-19 09:49:59.397    at void androidx.viewpager.widget.ViewPager.onMeasure(int, int) (ViewPager.java:1622)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void android.view.ViewGroup.measureChildWithMargins(android.view.View, int, int, int, int) (ViewGroup.java:7951)
03-19 09:49:59.397    at void androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasureChild(android.view.View, int, int, int, int) (CoordinatorLayout.java:760)
03-19 09:49:59.397    at boolean com.google.android.material.appbar.HeaderScrollingViewBehavior.onMeasureChild(androidx.coordinatorlayout.widget.CoordinatorLayout, android.view.View, int, int, int, int) (HeaderScrollingViewBehavior.java:99)
03-19 09:49:59.397    at boolean com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior.onMeasureChild(androidx.coordinatorlayout.widget.CoordinatorLayout, android.view.View, int, int, int, int) (AppBarLayout.java:1996)
03-19 09:49:59.397    at void androidx.coordinatorlayout.widget.CoordinatorLayout.onMeasure(int, int) (CoordinatorLayout.java:831)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void android.view.ViewGroup.measureChildWithMargins(android.view.View, int, int, int, int) (ViewGroup.java:7951)
03-19 09:49:59.397    at void android.widget.FrameLayout.onMeasure(int, int) (FrameLayout.java:194)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void android.widget.LinearLayout.measureVertical(int, int) (LinearLayout.java:995)
03-19 09:49:59.397    at void android.widget.LinearLayout.onMeasure(int, int) (LinearLayout.java:721)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void android.view.ViewGroup.measureChildWithMargins(android.view.View, int, int, int, int) (ViewGroup.java:7951)
03-19 09:49:59.397    at void android.widget.FrameLayout.onMeasure(int, int) (FrameLayout.java:194)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void androidx.drawerlayout.widget.DrawerLayout.onMeasure(int, int) (DrawerLayout.java:1156)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void crc643f46942d9dd1fff9.PlatformRenderer.n_onMeasure(int, int) (PlatformRenderer.java:-2)
03-19 09:49:59.397    at void crc643f46942d9dd1fff9.PlatformRenderer.onMeasure(int, int) (PlatformRenderer.java:71)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void android.widget.RelativeLayout.measureChildHorizontal(android.view.View, android.widget.RelativeLayout$LayoutParams, int, int) (RelativeLayout.java:735)
03-19 09:49:59.397    at void android.widget.RelativeLayout.onMeasure(int, int) (RelativeLayout.java:481)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void android.view.ViewGroup.measureChildWithMargins(android.view.View, int, int, int, int) (ViewGroup.java:7951)
03-19 09:49:59.397    at void android.widget.FrameLayout.onMeasure(int, int) (FrameLayout.java:194)
03-19 09:49:59.397    at void androidx.appcompat.widget.ContentFrameLayout.onMeasure(int, int) (ContentFrameLayout.java:146)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void android.view.ViewGroup.measureChildWithMargins(android.view.View, int, int, int, int) (ViewGroup.java:7951)
03-19 09:49:59.397    at void android.widget.FrameLayout.onMeasure(int, int) (FrameLayout.java:194)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void android.view.ViewGroup.measureChildWithMargins(android.view.View, int, int, int, int) (ViewGroup.java:7951)
03-19 09:49:59.397    at void android.widget.FrameLayout.onMeasure(int, int) (FrameLayout.java:194)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void android.view.ViewGroup.measureChildWithMargins(android.view.View, int, int, int, int) (ViewGroup.java:7951)
03-19 09:49:59.397    at void android.widget.LinearLayout.measureChildBeforeLayout(android.view.View, int, int, int, int, int) (LinearLayout.java:1552)
03-19 09:49:59.397    at void android.widget.LinearLayout.measureVertical(int, int) (LinearLayout.java:842)
03-19 09:49:59.397    at void android.widget.LinearLayout.onMeasure(int, int) (LinearLayout.java:721)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void android.view.ViewGroup.measureChildWithMargins(android.view.View, int, int, int, int) (ViewGroup.java:7951)
03-19 09:49:59.397    at void android.widget.FrameLayout.onMeasure(int, int) (FrameLayout.java:194)
03-19 09:49:59.397    at void com.android.internal.policy.DecorView.onMeasure(int, int) (DecorView.java:1159)
03-19 09:49:59.397    at void android.view.View.measure(int, int) (View.java:27145)
03-19 09:49:59.397    at void android.view.ViewRootImpl.performMeasure(int, int) (ViewRootImpl.java:4075)
03-19 09:49:59.397    at boolean android.view.ViewRootImpl.measureHierarchy(android.view.View, android.view.WindowManager$LayoutParams, android.content.res.Resources, int, int) (ViewRootImpl.java:2837)
03-19 09:49:59.397    at void android.view.ViewRootImpl.performTraversals() (ViewRootImpl.java:3100)
03-19 09:49:59.397    at void android.view.ViewRootImpl.doTraversal() (ViewRootImpl.java:2519)
03-19 09:49:59.397    at void android.view.ViewRootImpl$TraversalRunnable.run() (ViewRootImpl.java:9775)
03-19 09:49:59.397    at void android.view.Choreographer$CallbackRecord.run(long) (Choreographer.java:1010)
03-19 09:49:59.397    at void android.view.Choreographer.doCallbacks(int, long) (Choreographer.java:809)
03-19 09:49:59.397    at void android.view.Choreographer.doFrame(long, int) (Choreographer.java:744)
03-19 09:49:59.397    at void android.view.Choreographer$FrameDisplayEventReceiver.run() (Choreographer.java:995)
03-19 09:49:59.397    at void android.os.Handler.handleCallback(android.os.Message) (Handler.java:938)
03-19 09:49:59.397    at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:99)
03-19 09:49:59.397    at void android.os.Looper.loop() (Looper.java:246)
03-19 09:49:59.397    at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:8425)
03-19 09:49:59.397    at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
03-19 09:49:59.397    at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:596)
03-19 09:49:59.397    at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1130)
03-19 09:49:59.397  
03-19 09:49:59.397      in call to NewString
03-19 09:49:59.397      from android.view.View crc64720bb2db43a66fe9.ShellFragmentContainer.n_onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)

@Jakar510
Copy link

@Redth Redth removed the s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. label Mar 22, 2021
@vincentcastagna
Copy link

Got this issue also randomly with a TabbedPage, no navigation page inside, no flyout.
This happens often when the app is idle/backgrounded for a long time and re opening it. Never had the chance to reproduce on debug builds, only release ones.

XF 5.0.0.2012
Target Framework : 11

@ducmerida
Copy link

I was able to reproduce the issue by :

  • Enabling the setting "Don't keep activities"
  • Minimize the application
  • Open the application from recent apps menu

I've reverted the recent AndroidX updates that I've installed in order to prevent the error to happen.
imagen

@vincentcastagna
Copy link

vincentcastagna commented Apr 6, 2021

@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

@jsuarezruiz jsuarezruiz removed the s/unverified New report that has yet to be verified label May 3, 2021
@joshuangfraedom
Copy link

joshuangfraedom commented May 11, 2021

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.

@EmilAlipiev
Copy link
Contributor

EmilAlipiev commented Jun 27, 2021

1.2.5.5 solves the problem any version above this is crashing.
anyone has proguard settings for this library? should this be just fine?

-keep public class androidx.fragment .** { *; }

@angelru
Copy link

angelru commented Sep 9, 2021

I also have the same bug in android I have the latest version of XF:

android.runtime.JavaProxyThrowable
crc643f46942d9dd1fff9.FormsAppCompatActivity.n_onStart

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

@jonathanantoine
Copy link
Author

@jsuarezruiz why unverified ? You have a repro project ?
@jfversluis this is for this reason I ask you if I were not doing a repro for nothing...😔

@jfversluis
Copy link
Member

@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.

@erlenddahl
Copy link

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.

@jfversluis
Copy link
Member

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!

@jonathanantoine
Copy link
Author

@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 😥

@ryanwilson-gpdgroup
Copy link

ryanwilson-gpdgroup commented Nov 9, 2021

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.

@KennyEng12
Copy link

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,
Kenny.

@Savage1024
Copy link

Savage1024 commented Dec 8, 2021

The same problem on different devices.

androidx.fragment.app.FragmentStateManager.createView
FragmentStateManager.java, line 513

**androidx.fragment.app.FragmentStateManager.createView
Java.Lang.IllegalArgumentException: No view found for id 0x1 (unknown) for fragment ShellItemRenderer{78f68ec} (e3c9e3e4-d045-4f16-950d-b10d09237e10 id=0x1)**


Main thread

    JniEnvironment+InstanceMethods.CallBooleanMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args)
    JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters)
    FragmentManager.ExecutePendingTransactions ()
    FragmentManagerExtensions.ExecutePendingTransactionsEx (AndroidX.Fragment.App.FragmentManager fragmentManager)
    ShellRenderer.Dispose (System.Boolean disposing)
    IDisposable.Dispose ()
    Platform+<>c__DisplayClass45_0.<Cleanup>g__DoCleanup|0 ()
    Platform.Cleanup (System.Collections.Generic.List`1[T] viewsToRemove, System.Collections.Generic.List`1[T] renderersToDispose)
    Platform.SetPage (Xamarin.Forms.Page newRoot)
    Platform.Dispose ()
    FormsAppCompatActivity.OnDestroy ()
    Activity.n_OnDestroy (System.IntPtr jnienv, System.IntPtr native__this)
    (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.8(intptr,intptr)
    java.lang.IllegalArgumentException: No view found for id 0x1 (unknown) for fragment ShellItemRenderer{8b32160} (49b26598-2a6d-4f94-9479-b5f7d53ed806 id=0x1)
    androidx.fragment.app.FragmentStateManager.createView FragmentStateManager.java:513
    androidx.fragment.app.FragmentStateManager.moveToExpectedState FragmentStateManager.java:282
    androidx.fragment.app.FragmentManager.executeOpsTogether FragmentManager.java:2189
    androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute FragmentManager.java:2100
    androidx.fragment.app.FragmentManager.execPendingActions FragmentManager.java:2002
    androidx.fragment.app.FragmentManager.executePendingTransactions FragmentManager.java:600
    crc643f46942d9dd1fff9.FormsAppCompatActivity.n_onDestroy(Native Method)
    crc643f46942d9dd1fff9.FormsAppCompatActivity.onDestroy FormsAppCompatActivity.java:88
    android.app.Activity.performDestroy Activity.java:6571
    android.app.Instrumentation.callActivityOnDestroy Instrumentation.java:1172
    android.app.ActivityThread.performDestroyActivity ActivityThread.java:4300
    android.app.ActivityThread.handleDestroyActivity ActivityThread.java:4331
    android.app.ActivityThread.-wrap5(ActivityThread.java)
    android.app.ActivityThread$H.handleMessage ActivityThread.java:1675
    android.os.Handler.dispatchMessage Handler.java:111
    android.os.Looper.loop Looper.java:207
    android.app.ActivityThread.main ActivityThread.java:6020
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run ZygoteInit.java:936
    com.android.internal.os.ZygoteInit.main ZygoteInit.java:797

@jfversluis
Copy link
Member

If anyone could provide a reproduction sample that would help very much!

@VitalyKnyazev
Copy link
Contributor

VitalyKnyazev commented Dec 8, 2021

Hi @jfversluis,

If anyone could provide a reproduction sample that would help very much!

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:
https://github.com/VitalyKnyazev/NavigationIssue

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.

@KennyEng12
Copy link

I was able to reproduce the issue by :

  • Enabling the setting "Don't keep activities"
  • Minimize the application
  • Open the application from recent apps menu

I've reverted the recent AndroidX updates that I've installed in order to prevent the error to happen. imagen

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,
Kenny.

@EmilAlipiev
Copy link
Contributor

was this solved in 5.0.0 Service Release 8 from 4 days ago? There is now all spaghetti with XF and AndroidX dependencies

@jfversluis
Copy link
Member

jfversluis commented Dec 15, 2021

Hi @jfversluis,

If anyone could provide a reproduction sample that would help very much!

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: https://github.com/VitalyKnyazev/NavigationIssue

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.

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.

@rachelkang here's a repo: https://github.com/Jakar510/DebugXamarinAndroidX/tree/master

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.

@EmilAlipiev

was this solved in 5.0.0 Service Release 8 from 4 days ago? There is now all spaghetti with XF and AndroidX dependencies

You tell me! :) I've been trying to go through reproductions here and seems fine for me... Love to hear your experience!

@VitalyKnyazev
Copy link
Contributor

VitalyKnyazev commented Dec 15, 2021

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: https://github.com/VitalyKnyazev/NavigationIssue

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.

Can you please take another look? I have attached screenshots for reference. SR8 still has the issue.

image

@jfversluis
Copy link
Member

jfversluis commented Dec 15, 2021

@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?

@jfversluis
Copy link
Member

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

@EmilAlipiev
Copy link
Contributor

anyone has update on that issue?

@MaTToX3
Copy link

MaTToX3 commented May 17, 2022

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:

image

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:

  • 1.2.5.4 which many people reported fixes the issue (not for us)
  • 1.3.6.3 also does not fix 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.

@dimonovdd
Copy link
Contributor

@MaTToX3 @jfversluis is there any solution to this problem?

@tentom
Copy link

tentom commented Sep 1, 2022

I had a similar issue, thought it was the same but I am not sure anymore.
Since the navigation and blank page and the Fragment container seems to have been two issues for me.

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.

@iliketaiko
Copy link

Is there any fix on this item.
If downgrade to 1.2.5.4 is a confirmed temporary solution.
Is there any place I can check the change list of AndroidX.Framgment?
I want to check what would be the impact if I downgrade AndroidX.Framgment from 1.4.1.1 to 1.2.5.4

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often p/Android t/bug 🐛
Projects
None yet
Development

No branches or pull requests