Android studio 3.5 loadRootFragment 一直报空指针,是因为Android X的原因吗?

来源:3-1 项目架构初始化

慕丝7386281

2019-11-12

2019-11-12 07:00:13.892 28901-28901/com.zxl.test E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.zxl.test, PID: 28901
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.zxl.test/com.zxl.test.ExampleActivity}: java.lang.NullPointerException: Attempt to read from field 'me.yokeyword.fragmentation.helper.internal.TransactionRecord me.yokeyword.fragmentation.SupportFragmentDelegate.mTransactionRecord' on a null object reference
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3046)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1688)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6798)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
     Caused by: java.lang.NullPointerException: Attempt to read from field 'me.yokeyword.fragmentation.helper.internal.TransactionRecord me.yokeyword.fragmentation.SupportFragmentDelegate.mTransactionRecord' on a null object reference
        at me.yokeyword.fragmentation.TransactionDelegate$2.run(TransactionDelegate.java:88)
        at me.yokeyword.fragmentation.queue.ActionQueue.enqueue(ActionQueue.java:30)
        at me.yokeyword.fragmentation.TransactionDelegate.enqueue(TransactionDelegate.java:340)
        at me.yokeyword.fragmentation.TransactionDelegate.loadRootTransaction(TransactionDelegate.java:82)
        at me.yokeyword.fragmentation.SupportActivityDelegate.loadRootFragment(SupportActivityDelegate.java:195)
        at me.yokeyword.fragmentation.SupportActivityDelegate.loadRootFragment(SupportActivityDelegate.java:191)
        at me.yokeyword.fragmentation.SupportActivity.loadRootFragment(SupportActivity.java:126)
        at com.zxl.latte_core.activties.ProxyActivty.initContainer(ProxyActivty.java:34)
        at com.zxl.latte_core.activties.ProxyActivty.onCreate(ProxyActivty.java:25)
        at android.app.Activity.performCreate(Activity.java:7003)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1230)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2899)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3046) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1688) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:67![图片描述](http://img1.sycdn.imooc.com/szimg/5dc9ec2b0913005618410376.jpg)98) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
写回答

4回答

慕丝7386281

提问者

2019-11-12

已解决

0
0

慕丝7386281

提问者

2019-11-12

麻烦老师您帮忙看一下,折磨我好几个小时了

0
0

慕丝7386281

提问者

2019-11-12

使用的库 是整个

api 'me.yokeyword:fragmentation:1.3.7'
api 'me.yokeyword:fragmentation-swipeback:1.3.7'


0
0

慕丝7386281

提问者

2019-11-12

//img1.sycdn.imooc.com/szimg/5dc9ed0b0954ceff11960271.jpg

//img1.sycdn.imooc.com/szimg/5dc9ec2b0913005618410376.jpg

这是报错的信息

0
0

Android通用框架设计与完整电商App开发

从第一行代码开始教你,通用且一键式配置的框架设计并轻松实现完整电商App

2028 学习 · 1182 问题

查看课程