Android 不幸的是系统用户界面已停止

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10422275/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 03:39:52  来源:igfitidea点击:

Unfortunately System UI has stopped

androidandroid-emulator

提问by Seraph

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? System message screenshot

每次在 WXGA800 模式下启动 4.0.3 模拟器时,我都会收到此消息。我的应用程序在不运行系统 UI 的情况下工作正常,除了不出现操作栏并且我无法测试我的操作栏功能。我的操作系统是 Win7 x64。SDK 修订版 19. 有什么想法吗? 系统消息截图

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.access00(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!

我想到了。当 hw.mainKeys 在 AVD 设置中设置为 false 时会发生这种情况。感谢您的回答!

采纳答案by MByD

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

您不能同时拥有系统栏和导航栏:

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

引起:java.lang.RuntimeException:平板设备无法显示导航栏和系统栏

This is taken from the source of TabletStatusBar#makeStatusBarViewnote the comment:

这是摘自TabletStatusBar#makeStatusBarView注释的来源:

     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) {
     }

回答by CoronaPintu

put hw.mainKeys=yesin your .android->avd->youavdfoldername->config
open file and change hw.mainKeys=yesits work for me

hw.mainKeys=yes放在您的 .android->avd->youavdfoldername->config
打开文件中并更改 hw.mainKeys=yes对我有用

回答by Alex Lockwood

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).

也许删除您当前的 AVD 并尝试制作一个新的?有时模拟器只是表现得很时髦(或者你可能输入了错误的设置)。

回答by mrudult

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. :)

当我第一次开始 android 开发时,我也遇到了同样的问题。我的系统很旧。它甚至不支持英特尔的 VT 技术。如果您的情况也是如此,拥有一台旧电脑,请使用小屏幕分辨率制作 avd,而不是使用选项卡(Galaxy Nexus)。使用诸如“WQVGA”之类的东西并将 RAM 更改为 1024 MB(如果您的系统大于该值)。然后部署。它对我有用。:)

回答by user1010160

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)

我发布了 Seraph 找到的答案,这样其他人就很清楚了。在 config.ini 文件中设置 hw.mainKeys=yes。在您的开发文件夹中检查它然后 sdk /.android / avd / (您的 AVD 的名称)

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

我注意到这个错误只发生在 V.4.0 和 v.4.03 中。

回答by PankajAndroid

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

更改配置文件 --> .android->avd->youavdfoldername->config
打开文件并更改
hw.dPad=yes
hw.mainKeys=yes