question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to parse composition

See original GitHub issue

Hi, guys. I have a crash on my release app. Crashes rarely happen, I can’t reproduce myself. Lottie version is v2.7.0. and it’s only happened in android 8.0 devices. Here is the log.

` Crashed: main at com.airbnb.lottie.LottieAnimationView$2.onResult(LottieAnimationView.java:68) at com.airbnb.lottie.LottieAnimationView$2.onResult(LottieAnimationView.java:66) at com.airbnb.lottie.LottieTask.notifyFailureListeners(LottieTask.java:167) at com.airbnb.lottie.LottieTask.access$000(LottieTask.java:26) at com.airbnb.lottie.LottieTask$1.run(LottieTask.java:142) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:198) at android.app.ActivityThread.main(ActivityThread.java:7015) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:521) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:837)

Fatal Exception: java.lang.IllegalStateException: Unable to parse composition at com.airbnb.lottie.LottieAnimationView$2.onResult(LottieAnimationView.java:68) at com.airbnb.lottie.LottieAnimationView$2.onResult(LottieAnimationView.java:66) at com.airbnb.lottie.LottieTask.notifyFailureListeners(LottieTask.java:167) at com.airbnb.lottie.LottieTask.access$000(LottieTask.java:26) at com.airbnb.lottie.LottieTask$1.run(LottieTask.java:142) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:198) at android.app.ActivityThread.main(ActivityThread.java:7015) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:521) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:837)

Caused by java.util.concurrent.ExecutionException: java.lang.AssertionError at java.util.concurrent.FutureTask.report(FutureTask.java:123) at java.util.concurrent.FutureTask.get(FutureTask.java:193) at com.airbnb.lottie.LottieTask$2.run(LottieTask.java:189)

Caused by java.lang.AssertionError at android.util.JsonReader.peek(JsonReader.java:363) at android.util.JsonReader.expect(JsonReader.java:308) at android.util.JsonReader.beginObject(JsonReader.java:293) at com.airbnb.lottie.parser.LottieCompositionParser.parse(LottieCompositionParser.java:42) at com.airbnb.lottie.LottieCompositionFactory.fromJsonReaderSync(LottieCompositionFactory.java:229) at com.airbnb.lottie.LottieCompositionFactory.fromJsonInputStreamSync(LottieCompositionFactory.java:163) at com.airbnb.lottie.LottieCompositionFactory.fromJsonInputStreamSync(LottieCompositionFactory.java:157) at com.airbnb.lottie.LottieCompositionFactory.fromRawResSync(LottieCompositionFactory.java:129) at com.airbnb.lottie.LottieCompositionFactory$2.call(LottieCompositionFactory.java:116) at com.airbnb.lottie.LottieCompositionFactory$2.call(LottieCompositionFactory.java:114) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)`

Thanks a lot!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:8

github_iconTop GitHub Comments

1reaction
chanjungkimcommented, Oct 13, 2020

Check if you have the file perfectly. It can occur when the JSON file doesn’t exist.

0reactions
zhulk3commented, Jul 2, 2020

I also have this crash,because I have two json files in raws and i load them in the same time,this will cause two threads operate one arrayList in the same time。so the solution is i load them by using LoadAnimationView.addLottieOnCompositionLoadedListeneadd to make sure load them in order!

I have the same usage with you–I have 3 LottieAnimationView loaded at the same time.But I didn’t find the reason why crash happend. So can you give more details? Thanks a lot anyway.

I also want to know why it crashed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lottie error:"Java.Lang.IllegalStateException: 'Unable to parse ...
IllegalStateException: 'Unable to parse composition'. Image for more information link. I want to insert gif to my project I tried to use ...
Read more >
Unable to parse composition · Issue #1829 · airbnb/lottie ...
I solved this same parse error. I deleted ' \ ' and first and last's ' " ' in my json lottie file....
Read more >
IllegalStateException: Unable to parse composition
IllegalStateException: Unable to parse composition · Describe the bug. I have some lottie files. Other file works fine, but only one file doesn't ......
Read more >
com.airbnb.lottie.LottieResult java code examples - Tabnine
@Override public LottieResult<LottieComposition> call() { return new ... IllegalArgumentException("Unable to parse composition")); return new ...
Read more >
Unable to parse composable template - Opster
Unable to parse composable template – How to solve this Elasticsearch error ... Before you begin reading this guide, we recommend you try...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found