Closed Harshjain2094 closed 1 year ago
I just loaded that animation locally and it worked with out issue. My guess is that something about filebin is not sending down that raw json such that Lottie isn't getting what you expect.
I also noticed that the json file references image_0 and image_1. You'll want those included in a zip file with the json file or you'll want them already available locally but then you need to call setImagesAssetsFolder
or setImageAssetDelegate
to tell Lottie where to find the images.
There is an issue if the network call fails while fetching the Lottie from url, there isn't a way to handle gracefully. Is there a method or callback handle such cases, because currently it crashes the application.
I tried with the same approach but if network exception happens it does not come in failure listener. It crashes the app with IllegalStateException
What exception are you getting that doesn't notify the failure listener?
I am having the same issue with setAnimationUrl(url, cache)
Fatal Exception: java.lang.IllegalStateException: Unable to parse composition
at com.airbnb.lottie.LottieAnimationView.lambda$static$0(LottieAnimationView.java:72)
at com.airbnb.lottie.LottieAnimationView$$ExternalSyntheticLambda2.onResult(D8$$SyntheticClass:2)
at com.airbnb.lottie.LottieAnimationView$1.onResult(LottieAnimationView.java:84)
at com.airbnb.lottie.LottieAnimationView$1.onResult(LottieAnimationView.java:77)
at com.airbnb.lottie.LottieTask.notifyFailureListeners(LottieTask.java:162)
at com.airbnb.lottie.LottieTask.lambda$notifyListeners$0$com-airbnb-lottie-LottieTask(LottieTask.java:138)
at com.airbnb.lottie.LottieTask$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:2)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8893)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Describe the bug Adding Url to load from Lottie Animation, using function setAnimationUrl(), if it is not able to fetch and load Lottie it throws IllegalStateException.
By adding setFailureListener() it does not get the callback. While if asset is used the callback for failure is triggered.
Steps To Reproduce Steps to reproduce the behavior:
Fatal Exception: java.lang.IllegalStateException: Unable to parse composition at com.airbnb.lottie.LottieAnimationView$1.onResult(LottieAnimationView.java:78) at com.airbnb.lottie.LottieAnimationView$1.onResult(LottieAnimationView.java:71) at com.airbnb.lottie.LottieAnimationView$3.onResult(LottieAnimationView.java:95) at com.airbnb.lottie.LottieAnimationView$3.onResult(LottieAnimationView.java:88) at com.airbnb.lottie.LottieTask.notifyFailureListeners(LottieTask.java:158) at com.airbnb.lottie.LottieTask.access$200(LottieTask.java:27) at com.airbnb.lottie.LottieTask$1.run(LottieTask.java:133) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7918) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)