在Fragment跳转时会出现NoSuchFieldError错误,经过与已有项目对比排查发现是implementation 'androidx.appcompat:appcompat:1.1.0'的引用版本问题,改回1.0.2就不存在问题了。如果是需要使用1.1.0版本,可以切换me.yokeyword.fragmentation到me.yokeyword.fragmentationx。
java.lang.NoSuchFieldError: No field mActive of type Landroid/util/SparseArray; in class Landroidx/fragment/app/FragmentManagerImpl; or its superclasses (declaration of 'androidx.fragment.app.FragmentManagerImpl' appears in /data/app/com.xxx.demo-5kBnCluNPsrYjqaIqD3UZg==/base.apk)
at androidx.fragment.app.FragmentationMagician.getActiveFragments(FragmentationMagician.java:145)
at me.yokeyword.fragmentation.helper.internal.VisibleDelegate.dispatchSupportVisible(VisibleDelegate.java:158)
at me.yokeyword.fragmentation.helper.internal.VisibleDelegate.safeDispatchUserVisibleHint(VisibleDelegate.java:131)
at me.yokeyword.fragmentation.helper.internal.VisibleDelegate.onHiddenChanged(VisibleDelegate.java:102)
at me.yokeyword.fragmentation.SupportFragmentDelegate.onHiddenChanged(SupportFragmentDelegate.java:205)
at me.yokeyword.fragmentation.SupportFragment.onHiddenChanged(SupportFragment.java:95)