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
Keyboard immediately crashes after opening on Android Marshmallow 6.0 #41
Comments
Thanks for reporting this issue. Your issue seems to be somehow connected with #40 , I will investigate this further. |
I've just released v0.2.4, which adds a crash handler and allows you to copy the captured error log. It would be great if you could try out the new version and if it still instantly crashes, copy the error log and paste it here. This would help me a lot to find and eliminate the source of the crash. Thanks in advance! |
Sure, I'll do that as soon as I have some time. I'll inform you when this is done :) |
Hey there, here's the error log you asked for. The specific message when I clicked on a text box was that Florisboard was in a crash loop and reverted to another keyboard in order to let me type. This is probably why there's several stacktraces.
Do note this is an old phone that I plan on changing soon as I said earlier, this is a very old Android version. Thanks for the awesome work (even if i can't try it yet) ! |
Hey Lurux, thanks for sending the stacktraces and the positive feedback :) I haven't been in Android Studio yet but based on the output it seems that it crashes somewhere while building the emoji UI. I will investigate this and push a fix commit later. One question: Just out of interest, you've written that you are on a very old Android version, would you mind sharing which one? |
Yeah, I've seen that indeed. I don't really know how Android works, but wouldn't it be a good idea to not build the emoji UI until the actual button is pressed ? It would save time when opening the keyboard 😃
6.0, I'm pretty I wrote that in the OP. Just a note, many emojis are glitched in openboard for me. I think this is linked to the old Android version. So depending on the way your emoji board is implemented, this may or may not be cleanly fixable in this case. Just a question by the way, is this keyboard based on something else or completely written from scratch ? I haven't seen anything mentioning this in the readme. 🤔 |
The media UI is created asynchronously to main UI, so it doesn't really affect startup performance. I actually had the mechanic of creating the media UI only when pressing on the emoji button, but abandoned it because it has a second long lag at the first time and the UX of that isn't great.
Welp this is awkward. But still thanks!
No, as far as I have seen the crash is because I'm interacting with the UI from a non-main thread where Android can get pretty upset about and just crashes your app. I'm not particularly sure why it only happens on your device but it doesn't have something to to with the glitchiness. (It only affects the rendering, and at most you have weird emojis in the media UI, but not a crash).
Nope, this keyboard has been written from scratch. (If you look at the very first commits you see the early and super-ugly tries of me understanding how an InputMethodService works in Android 😄 ). Only a few concepts in how to align the keyboard in the window have been inspired by the AOSP LatinIME (e.g. ViewLayoutUtils.kt), because I would have never been able to do that without looking at their implementation. Also some parts of my crash handler are inspired by the CAOC library. Note, that I've added document comments within those source files to mark that my code has been inspired by these, alongside with the license and a reference to the corresponding original file. Some functions also have links to StackOverflow questions, so everyone can follow along where I got this exact implementation for a specific method. Everything else, especially the keyboard layout implementation has been made from scratch. Basically every other open-source keyboard relies on the default KeyboardView class + xml layouts, mine is a custom implementation and works with json layout files. Feel free to ask me anything if you are interested further! |
Why awkward ?
I'm really curious, what was your main reason to write everything from scratch ? 🤔 Btw, please tell me when the bug is fixed, I can't wait to give this a try ! 😃 |
Awkward because you wrote your Android version in the original comment and I haven't checked it before asking...
Mainly because all popular open-source keyboards are based on the default KeyboardView implementation, which is officially deprecated since Android 10 (but still fully working even in Android 11). If Google ever decides to remove this class in a future Android release, I'm prepped for this and FlorisBoard will fully work without having to rewrite the core. Also I wasn't a fan of how the xml keyboard layouts are defined, with my custom implementation I have full control over how the json layout file should look like.
Will do as soon as I push a fix commit! 😄 |
Above commit fixes the initialization of EmojiKeyboardView, allowing FlorisBoard to fully work on Android 6.0 devices. Will be included in the next release v0.2.5, which will be released tomorrow evening. |
Wait, isn't this what the AOSP keyboard is still using ? I would assume most open-source keyboards are based on that, and I doubt KeyboardView would be removed before AOSP stops using it...
Is it normal the milestone you set is for 0.3 ? Anyway, I see the release is not here yet, I'll try it out when it comes out ! |
Yeah that's a good point but still from a programmer's perspective I like my approach more and I have a way more granular control over how the KeyboardView works, so I'm going with the custom implementation.
Yes because I want this feature to be ready not later then v0.3.0. To decrease waiting times on new features and fixes I do releases like v0.2.5 to get them faster to the end user. |
I would agree diversity is important anyway, I was just being curious 😉
Ah okay, that makes sense. |
When clicking on an input field in Android 6.0, the keyboard appears for a little bit, but a popup saying "Florisboard stopped working" appears immediately after.
Environment information
Steps to reproduce
The text was updated successfully, but these errors were encountered: