Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCrash: java.lang.IllegalStateException Unable to create layer for LottieAnimationView, size 1088x-448 max size 8192 color type 4 has context 1 #1387
Comments
|
Face the same issue,when will this problem to be solved? |
|
it is really hard to reproduce. |
|
+1 , now we have 5000+ crash report. 3.x use gpu , is this the same problem? StackTrace in Android 5.0/5.1: java.lang.IllegalStateException: Unable to create layer for LottieAnimationView @62b16e5 |
|
@gpeal , where should i set this "setRenderMode(RenderModel.SOFTWARE)" |
|
@DineshBabuYadav on your |
|
Seeing this crash exclusively on Android 9 devices, even after setting the rendering mode to Software in the XML:
|
|
Update: Upgrading to |
|
I only see this crash on Samsung devices with Android 9 - J4+ and J6+ |
|
Any updates on this? is this related to the dirty xml layout & animation as well for below API 5.0? In my case, I've |
|
3.0.7 + |
|
3.1.0 , Face the same issue,when will this problem to be solved? |
tried |
|
I'm seeing this as well in Crashlytics. Already have it using Note that for me it's only happening on LG devices with Android 9. |
|
@dandroidbluecrew Are you sure it isn't caused by another animation? |
|
@gpeal This is really the only animation in the app, and the crash started showing up in Crashlytics in the exact build where we first integrated the Lottie SDK and added the animation. We have it in the layout XML nested within some other layout elements:
Devices affected: Here is the stack trace that shows up in Crashlytics:
|
|
@lchad @GeeJoe @DineshBabuYadav @andrewmunn Can you share the complete set of devices this is happening on? |
Yes, its related to same, as RecyclerView inside scrollview or nestedscrollview try to load all items at once. As RecyclerView loads all items also that are not visible. If you put log inside onBindViewHolder of RecylerView you find that all items loads at the start instead of based on the visibility of the item. This causes the parent LinearLayout (inside the ScrollView) to throw exception. I had also issue related to same with Recyclerview without animation. |
|
I just ordered an LG Aristo 3 Plus. Let's see if I can reproduce this. @dandroidbluecrew Could you attach the animation that crashes? If you can't attach it here, send it to |
|
@gpeal Thank you for continuing to look into this! Here's the animation: Also, here's the current device list in Crashlytics for our latest build: |
|
@lchad @dandroidbluecrew @mochadwi @nokite The Aristo 3+ arrived running Pie and I am unable to reproduce the crash with the attached animation. I tried different combinations of hardware/software rendering and rendering many animations or animations that are larger than the screen (or both), landscape and portrait. One theme I see in the stack traces where the full message was posted is that one dimension was either larger than the screen dimension (1088 or 5568) or 0. Can you try and adjust your layouts such that this never happens? Any other information you can provide (animations, layouts, etc.) would be helpful. |
|
@mochadwi It totally depends in the layout itself. Just try to make sure it is constrained to the screen size however you construct your layouts. This may or may not require landscape layouts depending on the specifics of your app. |
I tried setRenderMode(RenderModel.SOFTWARE) and it worked for me |
|
But I get a new crash on Android 7.0 recently. Here is the stack of the crash It is similar to this https://github.com/airbnb/lottie-android/issues/1199,which the recommend answer is also setRenderMode(RenderModel.SOFTWARE) I haven't try it,the stack is confused |
|
im also having this issue, only on Android 9. The LottieView is inside a RelativeLayout, nothing fancy, not inside a recyclerview Fatal Exception: java.lang.IllegalStateException: Unable to create layer for LottieAnimationView, size 1088x-320 max size 16384 color type 4 has context 1 @gpeal |
|
@carloshs94 1088 is slightly taller than 1080 which might be the resolution for some of those devices. Could you check your layout and see if there is anything that could cause it to be taller than the screen? |
|
Why does this happen on these specific samsung and lg devices? Is it the screen size or hardware config or something else? A good video on this which kinda explains some of it : https://www.youtube.com/watch?v=wIy8g8yNhNk&feature=youtu.be&list=PLWz5rJ2EKKc9CBxr3BVjPTPoDPLdPIFCE&t=247 Similar crash : https://issuetracker.google.com/issues/118714995 |
|
For me it's happening only for HUAWEI devices (nova, honor 6x, P9 lite) on Android 7.0. I'm using lottie in react-native |
|
Occurring for me on Vodafone 895 |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.





I just upgrade lottie version from 2.7.0 to 3.0.7.
I got some new crash in the latest version app.
StackTrace in Android 9:
main(2)
java.lang.IllegalStateException
Unable to create layer for LottieAnimationView, size 1088x-448 max size 16384 color type 4 has context 1
1 android.os.MessageQueue.nativePollOnce(Native Method)
2 android.os.MessageQueue.next(MessageQueue.java:330)
3 android.os.Looper.loop(Looper.java:169)
4 android.app.ActivityThread.main(ActivityThread.java:7083)
5 java.lang.reflect.Method.invoke(Native Method)
6 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
7 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)
Anyone is try to fix this problem?