Android Studio - No accent appears

Asked

Viewed 1,375 times

6

Hello, I have a very strange error in Android Studio, suddenly it stopped accepting the accents in the string and comments, when I try to type for example "is" it shows only "a". I’ve tried everything on File Encoding and nothing. Could anyone help me? Thanks.

Print do File Encondings

  • You were luckier than I, who never saw accents in the code (nor in the comments). To see accents, I define strings in /res/values/strings.xml. and use them in place of hardcode strings in the code. I believe it’s the software’s strategy to avoid strange behaviors, but it’s just a hunch.

  • The problem is not there, the IDE is not accepting accents or strings.xml

  • Ah, got it. Try it like this: write the text on the Otepad, copy and paste. See if the app compiles and accepts the accents, I know... is not a solution, but a branch break. At least vc does not run out of accent.

  • Yes, it compiles. It has snippets of code in the project already with accents, before this error happens, the app runs normal.

  • Have you tried restarting the ide? Sometimes it gives bizarre bugs. here with me happens with certain frequency one that the ide simply "forgets" that I typed new code and insists on compiling the version "old".

  • Already, updated and rebooted.

  • Worst case scenario is just reinstalling the IDE, sometimes it’s faster than finding the solution, of course, knowing what the problem was is always good.

  • I installed it on another computer and the accents worked well. I suspect it is some plugin. You have installed some recently?

Show 3 more comments

2 answers

5

I solved the problem by applying this solution "Frozen Keyboard input - "ibus" problems on Linux" described in: https://developer.android.com/studio/known-issues.html

At first he says that there is an interaction between the ibus daemon and Android Studio and that in some cases the IDE can stop responding to the keyboard or inserting random things. This bug has already been reported for Jetbrains and ibus.

In the link informs that the solution to this problem and runs the code below before running Android Studio to force ibus in synchronous mode.

$ IBUS_ENABLE_SYNC_MODE=1 ibus-daemon -xrd

Or run this other code to disable ibus for Android Studio:

$ XMODIFIERS= ./bin/studio.sh

Finally... I used the first one and it worked for me. I had already tried everything, reinstall Android Studio, delete all the settings (including create a new user, because in root inputs worked). I was already thinking of changing OS. I’m using Elementary OS 0.4.1 Loki

2

Maybe, in Ubuntu, to regain accentuation, it is only necessary to execute the command in the terminal:
ibus-daemon -drx

But in Elementary OS I did not have the same luck. It was necessary to do the following:

How I solved the Android Studio accent problem on Elementary OS.

First of all, This is Lementary OS problem (or Linux you are using) and not from Android Studio. So, no use reinstalling, won’t solve!

Solving...

In Elentary OS
Step 1: Install "ibus QT4".
In a terminal:
sudo apt install ibus-qt4

Step 2: Open the ibus
ibus-setup

Step 3: In the second tab, "Input Method", check if you have the option "Portuguese - Portuguese(Brazil)".

  • 3.a) If you do not have the entry "Portuguese - Portuguese(Brazil)", click on the button next to "Add", search for "Portuguese - Portuguese(Brazil)" and add. Go to the step 3.B;
  • 3.B) If you have the entry "Portuguese - Portuguese(Brazil)", delete the entry "English" and leave only the "Portuguese". Close the ibus and go to the step 4;

Step 4: After you close ibus, type in the terminal:
ibus-daemon -drx

Now do a test. This will solve the problem until the next reset. To keep running "4éva", you need to put the command of the step 4 on automatic startup (on Elementary OS).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.