Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto suggestions disappeared after upgrading to Android 13 #901

Open
blochl opened this issue Aug 25, 2022 · 28 comments
Open

Auto suggestions disappeared after upgrading to Android 13 #901

blochl opened this issue Aug 25, 2022 · 28 comments

Comments

@blochl
Copy link

blochl commented Aug 25, 2022

WARNING: This is a rather ancient project that was originally developed back in 2011 based on the Android 2.3 (Gingerbread) AOSP keyboard. While it still works as-is for many users, it would need some major rewrites to work with newer APIs, and some features such as language switching or popup keys don't work right on modern Android systems. I'm not currently planning on significant updates, and it's possible that it will stop working on modern devices or will no longer be updateable via the Google Play store due to minimum API level requirements. Play Store requires targeting API level 29 (Android 10), while the code was written for API level 9 (Android 2.3) from 2011.

I am aware it's an old project, but I absolutely love it, and didn't find a suitable alternative for years now.

Describe the bug
After upgrading to Android 13, the word suggestions disappeared. I do have the dictionaries installed.

To Reproduce
Start typing a message - no orange suggestions appear above the keyboard.

Expected behavior
Once typing a message, word suggestions appear above the keyboard. Even before typing - suggestions for punctuation marks appear.

Screenshots
no-suggestions

Smartphone (please complete the following information):

  • Device: Pixel 4a 5G
  • OS: Android 13
  • App version 1.40.7
@mansr
Copy link

mansr commented Sep 1, 2022

I've noticed the same thing on Pixel 5. The predictions seem to be generated since space/punctuation completes the word as expected.

@AeSix
Copy link

AeSix commented Nov 6, 2022

S22 Ultra, same issue.
So, not just the pixel

@MrSent
Copy link

MrSent commented Nov 16, 2022

Same on the Galaxy Note20

@acidstout
Copy link

acidstout commented Dec 1, 2022

This happens on all devices running Android 13 afaik. It would be a shame if this kinda kills Hacker's Keyboard, because it's the world's best keyboard ever. Seriously, if anyone's able to fix it, please do so. I would try to fix it if I could. Unfortunately my knowledge of developing Android apps is pretty much non-existing. :(

@Foo-Manroot
Copy link

It looks like there was a change in Android 13 that affected all soft keyboards, not only this one.

According to https://issuetracker.google.com/issues/246132117 , this issue is assigned; so there should be an Android update at some point that will fix it (hopefully soon). I tried the workaround that they mention, setCandidatesViewShown(true);, but the issue persists. Maybe I did it wrong, idk, I'm not familiar with soft keyboard development, nor with this codebase...

There's also a recent StackOverflow question which might be related, it can be worth keeping an eye on it: https://stackoverflow.com/questions/75353455/from-android-12-onward-candidateview-or-suggestion-list-not-showing-up-in-custom

ecm-pushbx added a commit to ecm-pushbx/hackerskeyboard that referenced this issue Mar 24, 2023
@ecm-pushbx
Copy link

I believe I fixed this. It isn't pretty but it seems to work fine for now. Patch is at c504b79

I also fixed an incompatibility between new ConnectBot versions and Hacker's Keyboard, refer to connectbot/connectbot#1038 -- patch is at d5a4ef1

@ecm-pushbx
Copy link

Added another fix to avoid the "double tap on Back needed for some applications" problem of my prior patch, this was mentioned in https://issuetracker.google.com/issues/246132117#comment18

ecm-pushbx@859b0d4

@ecm-pushbx
Copy link

If someone wants to try without having to build from the sources, I uploaded debug APKs that work on my device, a Nothing Phone (1), to https://pushbx.org/ecm/test/20230325/

@Foo-Manroot
Copy link

Hi

Thank you very much for taking the time!
I'm not quite sure what I did wrong, because setCandidatesViewShown() does indeed work correctly... Maybe I just added it to the wrong subclass, idk

In any case, I confirm this fixes the issue on LineageOS 20.0. Now I can see the suggestions again

@ecm-pushbx
Copy link

ecm-pushbx commented Mar 25, 2023

It's important to call super.setCandidatesViewShown. In my testing it appears you only need to call the super. prefixed function actually, and not the ones provided by our class. I'm just learning all of this so it is trial and error.

Also, there still are bugs around this, for example whenever I send a message in the blabber.im app the keyboard disappears and immediately re-appears.

@ecm-pushbx
Copy link

Updated with another bugfix to address the last problem I mentioned, ecm-pushbx@b12891b

@ecm-pushbx
Copy link

ecm-pushbx commented Mar 26, 2023

I wrote about my bugfixes on my blog: https://pushbx.org/ecm/dokuwiki/doku.php?id=blog:pushbx:2023:0326_more_ldebug_getinput_work_hacker_s_keyboard_app_modding (This also contains a description of what I had to do to make the app build.)

shiami pushed a commit to PhahTaigi/PhahTaigi_Android that referenced this issue Sep 20, 2023
@blochl
Copy link
Author

blochl commented Oct 22, 2023

Any chance that it will be updated on Google Play?

@ecm-pushbx
Copy link

Any chance that it will be updated on Google Play?

Hi, just wanted to quickly reply. I think that the targeted Android platform version is too old for the Play store. I don't know how much work it would be to update that. I also don't know generally what is entailed in getting an app published there. This is the very first time I did any work on an Android app.

@TPS
Copy link
Contributor

TPS commented Oct 23, 2023

@ecm-pushbx Still, if you were to open a PR here for @klausw to review & approve, it would make it to F-droid, where HK's a mainstay.

@Kl3nch
Copy link

Kl3nch commented Jan 1, 2024

Just a note to flag up that I'm having the same issue on a Nokia X30 running Android 13, stock not rooted.

@SelenaSaberWind
Copy link

I wrote about my bugfixes on my blog: https://pushbx.org/ecm/dokuwiki/doku.php?id=blog:pushbx:2023:0326_more_ldebug_getinput_work_hacker_s_keyboard_app_modding (This also contains a description of what I had to do to make the app build.)

If you have a moment, would you be so kind as to tell me how to implement your fix please? I'm not a programmer/developer, so this is new territory for me. TYSM!

@TPS
Copy link
Contributor

TPS commented Feb 28, 2024

If someone wants to try without having to build from the sources, I uploaded debug APKs that work on my device, a Nothing Phone (1), to https://pushbx.org/ecm/test/20230325/

@SelenaSaberWind Did you try the build uploaded here?

@nabijaczleweli
Copy link

I can reproduce this (at least I think this is the same thing):
on Lineage 16 (Android 9), I see the punctuation bar populated:

and on Lineage 21 (Android 14), it's still there, but empty:

Installing @ecm-pushbx's fork (building android programs is insurmountable for me, so from https://pushbx.org/ecm/test/20230325/20230326.1.apk (thanks for linking the page in the blog post, sorry for scraping it for the newest version)) fixed it :)

@nabijaczleweli
Copy link

Or not; it actually works everywhere except for ConnectBot where clicking on the text to pop up the esc/ctrl/left/&c. controls hides the keyboard and it's sometimes difficult to pull up again.

@nabijaczleweli
Copy link

With minor issues (https://101010.pl/@nabijaczleweli/112320802836461846) I found the bug in @ecm-pushbx's fix (nabijaczleweli@d9a4041), yielding 1041006.apk in https://lfs.nabijaczleweli.xyz/0019-org.pocketworkstation.pckeyboard (cf. bisect in INDEX and branches/tags on https://github.com/nabijaczleweli/hackerskeyboard).

@TPS
Copy link
Contributor

TPS commented Apr 23, 2024

@nabijaczleweli: https://github.com/SeventhM/hackerskeyboard seems to be the most active current fork. Maybe PR there so @SeventhM might review?

@SeventhM
Copy link

Note: after some testing around, ecm-pushbx's fix only kinda works on my fork. I managed to break viewing candidates. Probably something to do with how I updated to AndroidX though I need to do a bit more follow ups. I also realized that particularly fix causes issues in some apps (notably chromium based browsers) where the keyboard gets shown, but hidden, requiring a use of the back button to dismiss it despite the keyboard not being entirely on the screen. I think I know what the relevant issue is here, but again, I need to do some follow up checks to understand what I broke about the candidates

@SeventhM
Copy link

SeventhM commented May 1, 2024

For anyone wanting to follow along with figuring out what I might've broke by accident: SeventhM#4

This would be a lot easier if I had a dictionary that worked. I know HK is supposed to work with AnySoft dictionaries, but they no longer release those as a separate app. I think(?) almost the whole app can be found here, so that might be an avenue to check. But I suspect that'll be a dead end. Plus it would likely be a better idea to implement the dictionary within the app as a default (while simply allowing external dictionaries as well) so we don't have this issue in the future

@nabijaczleweli
Copy link

Somehow I don't think this is at all related to dictionaries, given that I'm (was) affected by this and don't use a dictionary.

@AeSix
Copy link

AeSix commented May 1, 2024

I'm pretty sure even though you don't use dictionaries for spell checking, that a dict is used for the suggested words. Since that's an integral part of the top bar, if that's not working properly - that bar may misbehave.

@nabijaczleweli
Copy link

nabijaczleweli commented May 1, 2024

It can't really be an integral part of the top bar if i haven't seen a word suggestion in the last five years and the bar works perfectly and as-expected. Probably.

@SeventhM
Copy link

SeventhM commented May 7, 2024

Turns out dictionaries wasn't entirely relevant, but getting them working is still helpful for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

13 participants