30

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

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!

Seraph
  • 562
  • 1
  • 4
  • 10
  • Look for the error message in Logcat and append it to your question, that should give more insight – zapl May 02 '12 at 22:05
  • Maybe delete your current AVD and try making a new one? Sometimes the emulator just acts funky... – Alex Lockwood May 02 '12 at 22:19
  • I updated as you said like this - hw.mainKeys=yes but still same issue. any other ideas. http://pastebin.com/juPb770C I also tried RAM with 'M', 'MB' and with number only. System windows - 7 – Damodar Bashyal Jan 08 '13 at 08:26

6 Answers6

9

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) {
     }
MByD
  • 135,866
  • 28
  • 264
  • 277
  • 11
    I figured it out. It happens when hw.mainKeys set to false in AVD setings. – Seraph May 02 '12 at 22:27
  • 2
    I was a little confused about what `hw.mainKeys=false` does. I'm still confused, but removing it leaves the emulator with a nav/system bar at the bottom of the screen with soft home and back keys, which is what you want, I think. – nmr May 25 '12 at 17:25
  • 1
    Avd Settings => Hardware Back/Home Keys => YES, solved the issues – max4ever Aug 08 '12 at 14:00
  • How could i do this, i have the Same Problem – MGR Apr 01 '13 at 11:59
  • 2
    In eclipse, I have edit the C:\Users\User\.android\avd\AVD_for_7in_WSVGA_Tablet.avd\config.ini – Lahiru Ruhunage Oct 08 '13 at 05:37
8

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

CoronaPintu
  • 1,865
  • 2
  • 17
  • 20
4

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

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
1

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

mrudult
  • 2,480
  • 3
  • 35
  • 54
1

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.

user1010160
  • 445
  • 3
  • 9
0

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

PankajAndroid
  • 2,689
  • 3
  • 27
  • 41