me.yokeyword.fragmentation的SparseArray错误

  在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)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。