JantHsueh/Fragmentation

使用androidx 大量报java.lang.IllegalAccessError 错误

br3ant opened this issue · 2 comments

java.lang.IllegalAccessError

Field 'androidx.fragment.app.FragmentManager.mStateSaved' is inaccessible to class 'androidx.fragment.app.FragmentationMagician'

1 androidx.fragment.app.FragmentationMagician.void hookStateSaved(androidx.fragment.app.FragmentManager,java.lang.Runnable)(FragmentationMagician.java:4)

2 androidx.fragment.app.FragmentationMagician.void popBackStackAllowingStateLoss(androidx.fragment.app.FragmentManager,java.lang.String,int)(FragmentationMagician.java:2)
3 me.yokeyword.fragmentation.TransactionDelegate.void safePopTo(java.lang.String,androidx.fragment.app.FragmentManager,int,java.util.List)(TransactionDelegate.java:98)
4 me.yokeyword.fragmentation.TransactionDelegate.void mockPopToAnim(androidx.fragment.app.Fragment,java.lang.String,androidx.fragment.app.FragmentManager,int,java.util.List,int)(TransactionDelegate.java:108)
5 me.yokeyword.fragmentation.TransactionDelegate.void doPopTo(java.lang.String,boolean,androidx.fragment.app.FragmentManager,int)(TransactionDelegate.java:91)
6 me.yokeyword.fragmentation.TransactionDelegate.void access$1200(me.yokeyword.fragmentation.TransactionDelegate,java.lang.String,boolean,androidx.fragment.app.FragmentManager,int)(TransactionDelegate.java:5)
7 me.yokeyword.fragmentation.TransactionDelegate$11.void run()(TransactionDelegate.java:1)
8 me.yokeyword.fragmentation.queue.ActionQueue.void handleAction()(ActionQueue.java:10)
9 me.yokeyword.fragmentation.queue.ActionQueue.void access$200(me.yokeyword.fragmentation.queue.ActionQueue)(ActionQueue.java:1)
10 me.yokeyword.fragmentation.queue.ActionQueue$2.void run()(ActionQueue.java:2)
11 android.os.Handler.handleCallback(Handler.java:739)
12 android.os.Handler.dispatchMessage(Handler.java:95)
13 android.os.Looper.loop(Looper.java:148)
14 android.app.ActivityThread.main(ActivityThread.java:5619)
15 java.lang.reflect.Method.invoke(Native Method)

需要提供一下这些信息
1、fragmentation 的版本号?
2、检查项目中最新的androidx.fragment 的版本号?(如果不会,可参考,我之前写的这篇文章

androidx FragmentManager 的2个成员变量
private boolean mStateSaved;
private boolean mStopped;
已经是私有的了,不能直接调用了

fragment 1.2.0 导致,使用反射