airbnb / lottie-android

Render After Effects animations natively on Android and iOS, Web, and React Native
http://airbnb.io/lottie/
Apache License 2.0
35.03k stars 5.41k forks source link

IllegalArgumentException (width must be > 0) occurs on Lottie 5.0.1 #2026

Closed hsahnv closed 2 years ago

hsahnv commented 2 years ago

Lottie is supported and developed on nights and weekends. Issues from Lottie sponsors will be prioritized.

Checklist

  1. My animation doesn't use any unsupported features.
  2. I know what part of my animation doesn't work.
  3. I have created a simplified version of my animation
  4. I have attached the AEP file (as a zip file so it can be attached) that only has the part of the animation that doesn't work.

Describe the bug A clear and concise description of what the bug is.

What version of Lottie did you test this on? 5.0.1

What version of Android did you test this on? 6.0.1, 7.0

63% Android 7 37% Android 6

Steps To Reproduce Steps to reproduce the behavior: I don't know steps, but see below details.

Devices: 50% Galaxy Note5 38% Galaxy Tab4 10.1 12% Galaxy A3(2016)

Stack trace:

Fatal Exception: java.lang.IllegalArgumentException: width must be > 0
       at android.graphics.Bitmap.checkWidthHeight(Bitmap.java:435)
       at android.graphics.Bitmap.createBitmap(Bitmap.java:824)
       at android.graphics.Bitmap.createBitmap(Bitmap.java:793)
       at com.airbnb.lottie.LottieDrawable.ensureSoftwareRenderingBitmap(LottieDrawable.java:1449)
       at com.airbnb.lottie.LottieDrawable.renderAndDrawAsBitmap(LottieDrawable.java:1397)
       at com.airbnb.lottie.LottieDrawable.draw(LottieDrawable.java:515)
       at android.widget.ImageView.onDraw(ImageView.java:1268)
       at android.view.View.draw(View.java:18394)
       at android.view.View.updateDisplayListIfDirty(View.java:17372)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3953)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3933)
       at android.view.View.updateDisplayListIfDirty(View.java:17335)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3953)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3933)
       at android.view.View.updateDisplayListIfDirty(View.java:17335)
       at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3953)
       at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3933)
       at android.view.View.updateDisplayListIfDirty(View.java:17335)
       at android.view.View.draw(View.java:18156)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3969)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3755)
       at android.view.View.updateDisplayListIfDirty(View.java:17367)
       at android.view.View.draw(View.java:18156)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3969)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3755)
       at android.view.View.updateDisplayListIfDirty(View.java:17367)
       at android.view.View.draw(View.java:18156)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3969)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3755)
       at android.view.View.draw(View.java:18397)
       at android.view.View.updateDisplayListIfDirty(View.java:17372)
       at android.view.View.draw(View.java:18156)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3969)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3755)
       at android.view.View.updateDisplayListIfDirty(View.java:17367)
       at android.view.View.draw(View.java:18156)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3969)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3755)
       at android.view.View.updateDisplayListIfDirty(View.java:17367)
       at android.view.View.draw(View.java:18156)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3969)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3755)
       at android.view.View.updateDisplayListIfDirty(View.java:17367)
       at android.view.View.draw(View.java:18156)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3969)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3755)
       at android.view.View.updateDisplayListIfDirty(View.java:17367)
       at android.view.View.draw(View.java:18156)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3969)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3755)
       at android.view.View.updateDisplayListIfDirty(View.java:17367)
       at android.view.View.draw(View.java:18156)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3969)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3755)
       at android.view.View.updateDisplayListIfDirty(View.java:17367)
       at android.view.View.draw(View.java:18156)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3969)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3755)
       at android.view.View.draw(View.java:18397)
       at com.android.internal.policy.DecorView.draw(DecorView.java:942)
       at android.view.View.updateDisplayListIfDirty(View.java:17372)
       at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:722)
       at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:728)
       at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:836)
       at android.view.ViewRootImpl.draw(ViewRootImpl.java:3181)
       at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2977)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2565)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1550)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7190)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:959)
       at android.view.Choreographer.doCallbacks(Choreographer.java:734)
       at android.view.Choreographer.doFrame(Choreographer.java:670)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:945)
       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:6776)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1496)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1386)

Screenshots None

guywest commented 2 years ago

I had the same crashes. when downgraded back to: "com.airbnb.android:lottie-compose:4.2.0" it worked fine. The crash occurs in the regular xml view.