当请求权限时,系统显示错误消息“系统UI已停止”并继续重新启动,直到您授予权限;
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.systemui, PID: 3910
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.android.systemui.statusbar.phone.NavigationBarFragment.onKeyguardOccludedChanged(boolean)' on a null object reference
at com.android.systemui.statusbar.phone.StatusBar.onKeyguardOccludedChanged(StatusBar.java:3843)
at com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager.setOccluded(StatusBarKeyguardViewManager.java:277)
at com.android.systemui.keyguard.KeyguardViewMediator.handleSetOccluded(KeyguardViewMediator.java:1176)
at com.android.systemui.keyguard.KeyguardViewMediator.-wrap14(Unknown Source:0)
at com.android.systemui.keyguard.KeyguardViewMediator$4.handleMessage(KeyguardViewMediator.java:1531)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
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)
我已经尝试过那些答案[1] [2],但没有一个能解决我的问题。 这只发生在模拟器中,在物理设备上就可以了;
[1] Unfortunately System UI has stopped
[2] Android Studio gradle Error: your emulator is out of date
答案 0 :(得分:4)
可能为时已晚,但这可能有助于其他人,这是模拟器的软按钮上的一个错误,解决方法是提高模拟器的分辨率并且不要忘了添加软按钮。 这帮助了我