Xamarin.Forms icon indicating copy to clipboard operation
Xamarin.Forms copied to clipboard

[Bug] MainActivity.OnCreate - InvalidOperationException: Collection was modified

Open TomasMalcanek opened this issue 2 years ago • 0 comments

Description

After launching the application it may randomly crash. Crash happens randomly. Probable cause is quick changing of viewed pages.

Steps to Reproduce

  1. Open the application

Expected Behavior

Set the main page and stay in the application.

Actual Behavior

Application crashes right after opening.

Basic Information

  • Version with issue: 5.0.0.2515
  • Last known good version: ---
  • Platform Target Frameworks:
    • iOS:
      • 12.5.5
      • 14.7.1
      • 14.8.1
      • 15.4.1
      • 15.3.1
      • 15.5
      • 15.4
      • 15.1
      • 15.2
    • Android:
      • 11
      • 12
  • Android Support Library / AndroidX Version:
  • NuGet Packages:
  • Affected Devices:
    • Galaxy S20 FE
    • Galaxy Z Flip3 5G
    • Galaxy Note20 Ultra 5G
    • Galaxy Note20 5G
    • Galaxy M30s
    • Galaxy S21 5G
    • Galaxy S20
    • Xiaomi 11T Pro
    • Galaxy S20 Ultra 5G
    • Galaxy S22 Ultra
    • iPhone 7
    • iPhone 11
    • iPhone SE (2nd gen)
    • iPhone 12
    • iPhone 8
    • iPhone XR
    • iPhone 12 Pro
    • iPhone 14.2
    • iPhone 13.4
    • iPhone 14.5

Environment

Show/Hide Visual Studio info

Stack trace

    List`1+Enumerator[T].MoveNextRare ()
    List`1+Enumerator[T].MoveNext ()
    NavigationProxy.set_Inner (Xamarin.Forms.INavigation value)
    Platform.SetPageInternal (Xamarin.Forms.Page newRoot)
    Platform.SetPage (Xamarin.Forms.Page newRoot)
    FormsAppCompatActivity.InternalSetPage (Xamarin.Forms.Page page)
    FormsAppCompatActivity.SetMainPage ()
    FormsAppCompatActivity.LoadApplication (Xamarin.Forms.Application application)
    MainActivity.OnCreate (Android.OS.Bundle bundle)
    Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState)
    JNINativeWrapper.Wrap_JniMarshal_PPL_V (_JniMarshal_PPL_V callback, System.IntPtr jnienv, System.IntPtr klazz, System.IntPtr p0)

Screenshots

Reproduction Link

Workaround

TomasMalcanek avatar Aug 19 '22 13:08 TomasMalcanek