You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a .zip animation with images is loaded from the cache, the library does not reload the bitmaps. The issue happens because the library recycle the bitmaps when the view is detached from the screen. When attempting the load the animation again, it finds it in the cache, but the bitmaps are never reloaded. This causes the app to crash.
The stacktrace is misleading because it assumes you haven't set the image folder, but it only reaches this point because it didn't load the images correctly when the animation is cached.
Stacktrace:
2018-11-26 17:02:00.224 19775-19775/com.wardbonnefond.lottietest E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.wardbonnefond.lottietest, PID: 19775
java.lang.IllegalStateException: You must set an images folder before loading an image. Set it with LottieComposition#setImagesFolder or LottieDrawable#setImagesFolder
at com.airbnb.lottie.manager.ImageAssetManager.bitmapForId(ImageAssetManager.java:107)
at com.airbnb.lottie.LottieDrawable.getImageAsset(LottieDrawable.java:839)
at com.airbnb.lottie.model.layer.ImageLayer.getBitmap(ImageLayer.java:68)
at com.airbnb.lottie.model.layer.ImageLayer.drawLayer(ImageLayer.java:32)
at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:201)
at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:100)
at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:201)
at com.airbnb.lottie.LottieDrawable.draw(LottieDrawable.java:319)
at android.widget.ImageView.onDraw(ImageView.java:1316)
at android.view.View.draw(View.java:17185)
at android.view.View.buildDrawingCacheImpl(View.java:16474)
at android.view.View.buildDrawingCache(View.java:16335)
at android.view.View.draw(View.java:16943)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.support.constraint.ConstraintLayout.dispatchDraw(ConstraintLayout.java:2023)
at android.view.View.updateDisplayListIfDirty(View.java:16162)
at android.view.View.draw(View.java:16951)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.updateDisplayListIfDirty(View.java:16162)
at android.view.View.draw(View.java:16951)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.updateDisplayListIfDirty(View.java:16162)
at android.view.View.draw(View.java:16951)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.updateDisplayListIfDirty(View.java:16162)
at android.view.View.draw(View.java:16951)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.updateDisplayListIfDirty(View.java:16162)
at android.view.View.draw(View.java:16951)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.draw(View.java:17188)
at com.android.internal.policy.DecorView.draw(DecorView.java:753)
at android.view.View.updateDisplayListIfDirty(View.java:16167)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:648)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:654)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:762)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2800)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2608)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2215)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:621)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
The text was updated successfully, but these errors were encountered:
When a
.zip
animation with images is loaded from the cache, the library does not reload the bitmaps. The issue happens because the library recycle the bitmaps when the view is detached from the screen. When attempting the load the animation again, it finds it in the cache, but the bitmaps are never reloaded. This causes the app to crash.Lottie version:
2.7.0
Lottie file: puppy_run.zip
Sample project showcasing the issue: LottieTest.zip
To reproduce:
The stacktrace is misleading because it assumes you haven't set the image folder, but it only reaches this point because it didn't load the images correctly when the animation is cached.
Stacktrace:
The text was updated successfully, but these errors were encountered: