问题描述【必填】:Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.app.Application.getApplicationInfo()' on a null object reference
at com.hjq.toast.ToastUtils.isDebugMode(ToastUtils.java:304)
at com.hjq.toast.ToastLogInterceptor.isLogEnable(ToastLogInterceptor.java:52)
at com.hjq.toast.ToastLogInterceptor.printToast(ToastLogInterceptor.java:24)
at com.hjq.toast.ToastLogInterceptor.intercept(ToastLogInterceptor.java:19)
at com.hjq.toast.ToastUtils.show(ToastUtils.java:209)
at com.hjq.toast.ToastUtils.show(ToastUtils.java:185)
at com.hjq.toast.ToastUtils.show(ToastUtils.java:179)
at android.view.KeyEvent.dispatch(KeyEvent.java:2713)
at android.app.Activity.dispatchKeyEvent(Activity.java:3373)
at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122)
at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84)
at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:599)
at com.chiquedoll.chiquedoll.view.activity.BaseActivity.dispatchKeyEvent(BaseActivity.java:841)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3089)
at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:381)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5082)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4950)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4471)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4524)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4490)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4630)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4498)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4687)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4471)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4524)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4490)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4498)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4471)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4524)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4490)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4663)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4824)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2571)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2081)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2072)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2548)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:160)
at android.app.ActivityThread.main(ActivityThread.java:6923)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870)
【警告:请务必按照 issue 模板填写,不要抱有侥幸心理,一旦发现 issue 没有按照模板认真填写,一律直接关闭】
问题描述
框架版本【必填】:11.2
问题描述【必填】:Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.app.Application.getApplicationInfo()' on a null object reference at com.hjq.toast.ToastUtils.isDebugMode(ToastUtils.java:304) at com.hjq.toast.ToastLogInterceptor.isLogEnable(ToastLogInterceptor.java:52) at com.hjq.toast.ToastLogInterceptor.printToast(ToastLogInterceptor.java:24) at com.hjq.toast.ToastLogInterceptor.intercept(ToastLogInterceptor.java:19) at com.hjq.toast.ToastUtils.show(ToastUtils.java:209) at com.hjq.toast.ToastUtils.show(ToastUtils.java:185) at com.hjq.toast.ToastUtils.show(ToastUtils.java:179)
复现步骤【必填】:弹出吐司时
是否必现【必填】:是, 偶发
出现问题的手机信息【必填】:品牌:motorola 型号:moto g(6) play 屏幕方向: 纵向 可用 RAM: 573.43 MB 可用磁盘空间: 468.6 MB 操作系统 版本:Android 9 屏幕方向: 纵向 是否已取得 root 权限:否
出现问题的安卓版本【必填】:Android 9
问题信息的来源渠道【必填】:应用程序异常手机
请回答
是部分机型还是所有机型都会出现【必答】:部分
框架最新的版本是否存在这个问题【必答】:是
是否已经查阅框架文档还未能解决的【必答】:是
issue 是否有人曾提过类似的问题【必答】:否(
是否可以通过 Demo 来复现该问题【必答】:否
使用原生的 Toast 是否也会出现该问题【必答】:否
其他
at android.view.KeyEvent.dispatch(KeyEvent.java:2713) at android.app.Activity.dispatchKeyEvent(Activity.java:3373) at androidx.core.app.ComponentActivity.superDispatchKeyEvent(ComponentActivity.java:122) at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:84) at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140) at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:599) at com.chiquedoll.chiquedoll.view.activity.BaseActivity.dispatchKeyEvent(BaseActivity.java:841) at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59) at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3089) at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:381) at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5082) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4950) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4471) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4524) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4490) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4630) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4498) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4687) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4471) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4524) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4490) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4498) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4471) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4524) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4490) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4663) at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4824) at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2571) at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2081) at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2072) at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2548) at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141) at android.os.MessageQueue.nativePollOnce(MessageQueue.java) at android.os.MessageQueue.next(MessageQueue.java:326) at android.os.Looper.loop(Looper.java:160) at android.app.ActivityThread.main(ActivityThread.java:6923) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870)