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

EmojiCompat raises exception in logcat every few seconds #561

Open
tatokis opened this issue Feb 7, 2023 · 0 comments
Open

EmojiCompat raises exception in logcat every few seconds #561

tatokis opened this issue Feb 7, 2023 · 0 comments
Labels

Comments

@tatokis
Copy link

tatokis commented Feb 7, 2023

Running stock LineageOS 18.1, and I observe the following printed in logcat every time a message is received, whether the app is in focus or in the background.

02-07 08:11:04.735 22040 22610 W System.err: java.lang.IllegalStateException: Not initialized yet
02-07 08:11:04.736 22040 22610 W System.err: 	at androidx.emoji2.text.EmojiCompat.process(SourceFile:33)
02-07 08:11:04.736 22040 22610 W System.err: 	at androidx.emoji2.text.EmojiCompat.process(SourceFile:34)
02-07 08:11:04.736 22040 22610 W System.err: 	at com.ubergeek42.WeechatAndroid.relay.Line.ensureSpannable(SourceFile:380)
02-07 08:11:04.736 22040 22610 W System.err: 	at com.ubergeek42.WeechatAndroid.relay.BufferList$$ExternalSyntheticLambda1.handleMessage(SourceFile:344)
02-07 08:11:04.736 22040 22610 W System.err: 	at com.ubergeek42.weechat.relay.connection.RelayConnection$$ExternalSyntheticLambda4.run(SourceFile:96)
02-07 08:11:04.736 22040 22610 W System.err: 	at androidx.core.app.ActivityCompat$$ExternalSyntheticLambda0.run(SourceFile:538)
02-07 08:11:04.736 22040 22610 W System.err: 	at com.ubergeek42.weechat.relay.connection.Utils$FriendlyThread.run(Unknown Source:7)

According to https://developer.android.com/reference/androidx/emoji/text/EmojiCompat#process(java.lang.CharSequence,int,int,int,int) process() throws IllegalStateException because init() has not been called.

@oakkitten oakkitten added the bug label Mar 9, 2024
oakkitten added a commit that referenced this issue Mar 9, 2024
We used to try emojifying regardless of EmojiCompat load state. This was not
a big issue, as `EmojiCompat` usually loads fast enough. However, on some
systems loading dynamic fonts is not available, which resulted in errors
printed for every emojification attempt, i. e. for every single line.

This change makes emojifications occur only when `EmojiCompat` is fully
initialized and loaded. Also, initialization status is printed to logcat.

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

No branches or pull requests

2 participants