Unfortunately System UI has stopped [duplicate]

匿名 (未验证) 提交于 2019-12-03 01:55:01

问题:

This question already has an answer here:

I gets this message every time I start 4.0.3 emulator in WXGA800 mode. My app works fine without running System UI except action bar does not appears and I can't test my actionbar functionality. My OS is Win7 x64. Sdk revision 19. Any ideas?

Stacktrace:

FATAL EXCEPTION: main java.lang.RuntimeException: Unable to create service com.android.systemui.SystemUIService: java.lang.RuntimeException: Tablet device cannot show navigation bar and system bar at android.app.ActivityThread.handleCreateService(ActivityThread.java:2263) at android.app.ActivityThread.access$1600(ActivityThread.java:123) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4424) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.RuntimeException: Tablet device cannot show navigation bar and system bar at com.android.systemui.statusbar.tablet.TabletStatusBar.makeStatusBarView(TabletStatusBar.java:451) at com.android.systemui.statusbar.StatusBar.start(StatusBar.java:64) at com.android.systemui.statusbar.tablet.TabletStatusBar.start(TabletStatusBar.java:390) at com.android.systemui.SystemUIService.onCreate(SystemUIService.java:93) at android.app.ActivityThread.handleCreateService(ActivityThread.java:2253) 

I figured it out. It happens when hw.mainKeys set to false in AVD setings. Thanks for your answers!

回答1:

You can't have both system bar and navigation bar:

Caused by: java.lang.RuntimeException: Tablet device cannot show navigation bar and system bar

This is taken from the source of TabletStatusBar#makeStatusBarView note the comment:

     try {          // Sanity-check that someone hasn't set up the config wrong and asked for a navigation          // bar on a tablet that has only the system bar          if (mWindowManager.hasNavigationBar()) {              throw new RuntimeException(                      "Tablet device cannot show navigation bar and system bar");          }      } catch (RemoteException ex) {      } 


回答2:

put hw.mainKeys=yes in your .android->avd->youavdfoldername->config
open file and change hw.mainKeys=yes its work for me



回答3:

Maybe delete your current AVD and try making a new one? Sometimes the emulator just acts funky (or perhaps you have entered the wrong settings).



回答4:

I also had the same issue when i first began android developement. My system was old. It didn't even supported Intel's VT technology. If same is the case with you, having a old pc, make an avd with small screen resolution rather than using the tab(Galaxy Nexus). Use something like 'WQVGA' and change the RAM to 1024 MB (if your system has greater than that). then deploy. It worked for me. :)



回答5:

I'm posting the answer Seraph found just so it's clear for others. Set the hw.mainKeys=yes in the config.ini file. Check it in your development folder then sdk /.android / avd / (name of your AVD)

I noticed this bug only happens in V.4.0 and v.4.03.



回答6:

chage config file in --> .android->avd->youavdfoldername->config
open file and change
hw.dPad=yes
hw.mainKeys=yes



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!