Keyboard issues with Android Studio on Ubuntu

16.1k Views Asked by At

While using Android Studio on Ubuntu there are scenarios where the IDE will stop responding to keyboard input or start inputting random characters?

How to fix this? Or possible workarounds.

5

There are 5 best solutions below

7
On BEST ANSWER

This is a known issue with:

The bug seems to be triggered by some missing synchronization between IBus (the server) and Xlib + AWT (the client JVM), exposed by a combination of a quick succession of key presses and the client’s slower event handling.

The 2 workarounds that helped me were:

Workaround #1: Force ibus in synchronous mode

$ IBUS_ENABLE_SYNC_MODE=1 ibus-daemon -xrd

Do this preferably before starting Studio. This workaround was suggested in https://code.google.com/p/ibus/issues/detail?id=1733 for a different Java application facing the same problems.

Workaround #2: Disable IBus input in Studio

$ XMODIFIERS= ./bin/studio.sh

This will only disable input methods for Studio, not the other applications. Restarting the daemon while Studio is running (‘ibus-daemon -rd’) effectively disables the input methods for all other applications, and can also crash Studio's JVM with a segmentation fault.

0
On

This is the only thing that worked for me on Ubuntu 20.04.

  • Close the Android Studio (if open)
  • Delete the Home/.android directory
  • Open Android Studio
  • Go to File > Invalidate Caches/Restart
  • Click the Invalidate and Restart button

I also deleted the project level .idea folder, can't say for sure if that did anything. You may try it.

5
On

File -> Invalidate Catches / Restart works for me.

0
On

Simply Restart the Android Studio. Everytime it'll restart the keyboard will start working well.

This is a know issue [Frozen keyboard input - "iBus" problems on Linux][1]

0
On

Restarting the IDE work in ubuntu 2020 Edison.