Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

简单版demo报错 #55

Closed
evelynEdison opened this issue Aug 22, 2022 · 1 comment
Closed

简单版demo报错 #55

evelynEdison opened this issue Aug 22, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@evelynEdison
Copy link

描述你遇到的问题
(点击首页列表中的简单版按钮,进入界面后只钩选开启拍摄功能,点击+按钮,进入拍照界面,点击返回按钮,应用崩溃,在OnePlus 7上必现)

是否使用作者Demo报错
(是)

如果是作者Demo出错

具体是代码的哪个分支:(androidx)
具体是Demo中哪个模块:(简单版)
该模块你改了哪些配置具体描述:(简单版中只钩选开启拍摄功能)
具体错误:
java.lang.RuntimeException: Unable to destroy activity {com.zhongjh.cameraapp/com.zhongjh.albumcamerarecorder.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.material.tabs.TabLayoutMediator.detach()' on a null object reference
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5309)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5339)
at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2246)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:233)
at android.app.ActivityThread.main(ActivityThread.java:8010)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.material.tabs.TabLayoutMediator.detach()' on a null object reference
at com.zhongjh.albumcamerarecorder.MainActivity.onDestroy(MainActivity.java:138)
at android.app.Activity.performDestroy(Activity.java:8251)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1364)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5294)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5339)
at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2246)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:233)
at android.app.ActivityThread.main(ActivityThread.java:8010)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)

期待修复的效果
(希望正常运行)

zhongjhATC pushed a commit that referenced this issue Aug 22, 2022
原因是在上次的优化内存更新底部控件后,如果处于单摄像的情况下,会导致null奔溃
@zhongjhATC
Copy link
Owner

非常感谢你的反馈!1.1.68X已经最新发布,可更新代码再次尝试一下!

@zhongjhATC zhongjhATC added the bug Something isn't working label Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants