简体   繁体   English

Ubuntu 上 Android Studio 的键盘问题

[英]Keyboard issues with Android Studio on Ubuntu

While using Android Studio on Ubuntu there are scenarios where the IDE will stop responding to keyboard input or start inputting random characters?在 Ubuntu 上使用 Android Studio 时,是否会出现 IDE 停止响应键盘输入或开始输入随机字符的情况?

How to fix this?如何解决这个问题? Or possible workarounds.或者可能的解决方法。

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.该错误似乎是由 IBus(服务器)和 Xlib + AWT(客户端 JVM)之间缺少同步触发的,通过快速连续按键和客户端较慢的事件处理的组合暴露。

The 2 workarounds that helped me were:帮助我的两种解决方法是:

Workaround #1 : Force ibus in synchronous mode解决方法 #1 :在同步模式下强制 ibus

 $ IBUS_ENABLE_SYNC_MODE=1 ibus-daemon -xrd

Do this preferably before starting Studio.最好在启动 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.对于面临相同问题的不同 Java 应用程序, https://code.google.com/p/ibus/issues/detail?id= 1733 中建议了此解决方法。

Workaround #2: Disable IBus input in Studio解决方法 #2:在 Studio 中禁用 IBus 输入

$ XMODIFIERS= ./bin/studio.sh

This will only disable input methods for Studio, not the other applications.这只会禁用 Studio 的输入法,而不是其他应用程序。 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.在 Studio 运行时重新启动守护程序 ('ibus-daemon -rd') 会有效地禁用所有其他应用程序的输入法,并且还会因分段错误而使 Studio 的 JVM 崩溃。

File -> Invalidate Catches / Restart对我File -> Invalidate Catches / Restart

Simply Restart the Android Studio.只需重新启动 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]这是一个已知问题[冻结的键盘输入 - Linux 上的“iBus”问题][1]

在 ubuntu 2020 Edison 中重新启动 IDE 工作。

This is the only thing that worked for me on Ubuntu 20.04.这是在 Ubuntu 20.04 上唯一对我有用的东西。

  • Close the Android Studio (if open)关闭 Android Studio(如果打开)
  • Delete the Home/.android directory删除Home/.android目录
  • Open Android Studio打开安卓工作室
  • Go to File > Invalidate Caches/Restart转到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.我还删除了项目级别的.idea文件夹,不能确定这是否有任何作用。 You may try it.你可以试试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM