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

Crash when constructing AXrLottieDrawable #16

Closed
fourlastor opened this issue Sep 22, 2021 · 3 comments · Fixed by #17
Closed

Crash when constructing AXrLottieDrawable #16

fourlastor opened this issue Sep 22, 2021 · 3 comments · Fixed by #17

Comments

@fourlastor
Copy link
Contributor

Hello, I'm seeing a crash (from analytics, I haven't been able to reproduce it myself yet) when initializing an AXrLottieDrawable:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.Handler.post(java.lang.Runnable)' on a null object reference
       at com.aghajari.rlottie.DispatchQueue.postRunnable(DispatchQueue.java:91)
       at com.aghajari.rlottie.DispatchQueue.postRunnable(DispatchQueue.java:81)
       at com.aghajari.rlottie.DispatchQueuePool.execute(DispatchQueuePool.java:94)
       at com.aghajari.rlottie.AXrLottieDrawable.scheduleNextGetFrame(AXrLottieDrawable.java:849)
       at com.aghajari.rlottie.AXrLottieDrawable.setAllowDecodeSingleFrame(AXrLottieDrawable.java:689)
       at com.aghajari.rlottie.AXrLottieDrawable.initFromJson(AXrLottieDrawable.java:491)
       at com.aghajari.rlottie.AXrLottieDrawable.<init>(AXrLottieDrawable.java:438)
       at com.aghajari.rlottie.AXrLottieDrawable$Builder.build(AXrLottieDrawable.java:1329)

After a bit of investigation, this seems to happen at this line of DispatchQueue.

I think the source of the NPE could be in the try/catch statement a few lines before, my guess is that syncLatch.await(); throws an InterruptedException before being released, which would lead to handler being null.

@Aghajari
Copy link
Owner

Hi @fourlastor ,
Check out v1.3.0

@fourlastor
Copy link
Contributor Author

fourlastor commented Nov 1, 2021

Hi! Thank you :) I'm going to have enough data on whether this fixed the initial bug or not in a couple weeks, I'll keep you posted!

@fourlastor
Copy link
Contributor Author

fourlastor commented Nov 9, 2021

Hi @Aghajari!

I'm getting a new crash with 1.3.1:

Caused by java.lang.UnsatisfiedLinkError: No implementation found for long com.aghajari.rlottie.AXrLottieNative.createWithJson(java.lang.String, java.lang.String, int[]) (tried Java_com_aghajari_rlottie_AXrLottieNative_createWithJson and Java_com_aghajari_rlottie_AXrLottieNative_createWithJson__Ljava_lang_String_2Ljava_lang_String_2_3I)
       at com.aghajari.rlottie.AXrLottieNative.createWithJson(AXrLottieNative.java)
       at com.aghajari.rlottie.AXrLottieDrawable.initFromJson(AXrLottieDrawable.java:491)
       at com.aghajari.rlottie.AXrLottieDrawable.<init>(AXrLottieDrawable.java:441)
       at com.aghajari.rlottie.AXrLottieDrawable$Builder.build(AXrLottieDrawable.java:1332)

It looks like it's not managing to load the library at runtime, but it doesn't crash, so it crashes whenever I use the animation view. Maybe something similar to Rive's approach might work?

Another approach I found looking things up is relinker

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

Successfully merging a pull request may close this issue.

2 participants