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

Fatal Exception: java.lang.RuntimeException: An error occured while executing doInBackground() Caused by java.io.EOFException: End of input #993

Closed
aliguvenc opened this issue Nov 9, 2018 · 3 comments

Comments

@aliguvenc
Copy link

Hi,
I am seeing this crash in production logs and not happening every time when animation is playing.
used lottie version is 2.5.5. Below is stacktrace and device/os info which are exposed that problem

screen shot 2018-11-09 at 12 09 26

Crashed: AsyncTask #1
at android.os.AsyncTask$3.done(AsyncTask.java:299)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
at java.util.concurrent.FutureTask.run(FutureTask.java:239)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)

--

Fatal Exception: java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:299)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
at java.util.concurrent.FutureTask.run(FutureTask.java:239)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)

Caused by java.lang.IllegalStateException: java.io.EOFException: End of input
at com.airbnb.lottie.parser.AsyncCompositionLoader.doInBackground(AsyncCompositionLoader.java:24)
at com.airbnb.lottie.parser.AsyncCompositionLoader.doInBackground(AsyncCompositionLoader.java:12)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)

Caused by java.io.EOFException: End of input
at android.util.JsonReader.nextNonWhitespace(JsonReader.java:830)
at android.util.JsonReader.nextValue(JsonReader.java:692)
at android.util.JsonReader.peek(JsonReader.java:334)
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.LottieComposition$Factory.fromJsonSync(LottieComposition.java:276)
at com.airbnb.lottie.parser.AsyncCompositionLoader.doInBackground(AsyncCompositionLoader.java:22)
at com.airbnb.lottie.parser.AsyncCompositionLoader.doInBackground(AsyncCompositionLoader.java:12)
at android.os.AsyncTask$2.call(AsyncTask.java:287)
at java.util.concurrent.FutureTask.run(FutureTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)

@keliuyue
Copy link

I also has this issue in my app .

Lottie Version : 2.5.7

Error log info

java.lang.RuntimeException: An error occurred while executing doInBackground()

at android.os.AsyncTask$3.done(AsyncTask.java:353)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
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)

Caused by: java.lang.IllegalStateException: java.io.EOFException: End of input
at com.airbnb.lottie.d.e.a(AsyncCompositionLoader.java:24)
at com.airbnb.lottie.d.e.doInBackground(AsyncCompositionLoader.java:12)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 3 more

Caused by: java.io.EOFException: End of input
at android.util.JsonReader.nextNonWhitespace(JsonReader.java:833)
at android.util.JsonReader.nextValue(JsonReader.java:695)
at android.util.JsonReader.peek(JsonReader.java:334)
at android.util.JsonReader.expect(JsonReader.java:308)
at android.util.JsonReader.beginObject(JsonReader.java:293)
at com.airbnb.lottie.d.u.a(LottieCompositionParser.java:42)
at com.airbnb.lottie.f$a.a(LottieComposition.java:276)
at com.airbnb.lottie.d.e.a(AsyncCompositionLoader.java:22)
... 6 more

java.lang.IllegalStateException: java.io.EOFException: End of input
at com.airbnb.lottie.d.e.a(AsyncCompositionLoader.java:24)
at com.airbnb.lottie.d.e.doInBackground(AsyncCompositionLoader.java:12)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
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)

Caused by: java.io.EOFException: End of input
at android.util.JsonReader.nextNonWhitespace(JsonReader.java:833)
at android.util.JsonReader.nextValue(JsonReader.java:695)
at android.util.JsonReader.peek(JsonReader.java:334)
at android.util.JsonReader.expect(JsonReader.java:308)
at android.util.JsonReader.beginObject(JsonReader.java:293)
at com.airbnb.lottie.d.u.a(LottieCompositionParser.java:42)
at com.airbnb.lottie.f$a.a(LottieComposition.java:276)
at com.airbnb.lottie.d.e.a(AsyncCompositionLoader.java:22)
... 6 more

java.io.EOFException: End of input
at android.util.JsonReader.nextNonWhitespace(JsonReader.java:833)
at android.util.JsonReader.nextValue(JsonReader.java:695)
at android.util.JsonReader.peek(JsonReader.java:334)
at android.util.JsonReader.expect(JsonReader.java:308)
at android.util.JsonReader.beginObject(JsonReader.java:293)
at com.airbnb.lottie.d.u.a(LottieCompositionParser.java:42)
at com.airbnb.lottie.f$a.a(LottieComposition.java:276)
at com.airbnb.lottie.d.e.a(AsyncCompositionLoader.java:22)
at com.airbnb.lottie.d.e.doInBackground(AsyncCompositionLoader.java:12)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
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)

@LeviWiz
Copy link

LeviWiz commented Nov 27, 2018

hey bro , have you fixed it?

@aliguvenc
Copy link
Author

hey @LeviWiz , i found a work around for that.

I was loading lottie animation on pre versions 2.7.0 like
LottieComposition lottieComposition = LottieComposition.Factory.fromInputStreamSync("animationName", true)

and on versions pre 2.7.0, if an any exception occurs, sdk was throwing runtime exception.

On versions greater than 2.7.0 they made some changes and if any exception occurs, composition result gets null. Here is my new code to load lottie animations;
LottieResult<LottieComposition> lottieComposition = LottieCompositionFactory.fromJsonStringSync("animationName", "animationName");

check if lottieComposition.getValue() != null and call lottieView.setComposition(lottieComposition.getValue());
lottieView.playAnimation();

if lottieComposition.getValue() == null then i put any another view like place holder

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

No branches or pull requests

3 participants