Abhimanyu14 / compose-emoji-picker

Apache License 2.0
32 stars 1 forks source link

Fatal Exception: java.lang.IndexOutOfBoundsException #13

Closed nizam-betterapp closed 7 months ago

nizam-betterapp commented 7 months ago

In the alpha14 build, we are seeing this crash consistently. Can you please help us here?

Fatal Exception: java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1 at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) at java.util.Objects.checkIndex(Objects.java:359) at java.util.ArrayList.get(ArrayList.java:434) at emoji.core.emojiparser.EmojiParserImpl.parseEmojiData(EmojiParserImpl.java:53) at emoji.core.emojiparser.EmojiParser$DefaultImpls.parseEmojiData$default(EmojiParser.java:6) at emoji.core.emojifetcher.EmojiFetcherImpl$fetchEmojiData$1.onResponse(EmojiFetcherImpl.kt:77) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)

Abhimanyu14 commented 7 months ago

Unicode.org removed the source file.

https://unicode.org/Public/emoji/15.0/emoji-test.txt

I am checking if there are alternatives.

Abhimanyu14 commented 7 months ago

Updated the unicode.org URL to the latest one as a short-term fix. Upgrading to alpha15 should fix the crash.

As a longer-term solution, I will try to host the file somewhere else to avoid this.

nizam-betterapp commented 7 months ago

Thanks for the quick fix. We got a velocity crash alert and your timely fix is super useful. Looking forward to a permanent solution.

Abhimanyu14 commented 6 months ago

Hi @nizam-betterapp, I have made changes to use a self-host URL for the emojis file.

P.S: A heads up, I am working on distributing the library using maven-central.