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
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
The text was updated successfully, but these errors were encountered:
To reproduce crash, add the following to the IssueReproActivity:
```
binding.animationView.setCacheComposition(false)
binding.animationView.renderMode = RenderMode.SOFTWARE
binding.animationView.postDelayed({ binding.animationView.setAnimation(R.raw.heart) }, 1000)
```
When it tries to render with null composition, `getIntrinsicWidth()` and `getIntrinsicHeight()` return `-1`, and both `renderWidth` and `renderHeight` end up being negative, which results in a crash:
```
java.lang.IllegalArgumentException: width must be > 0
at android.graphics.Bitmap.checkWidthHeight(Bitmap.java:378)
at android.graphics.Bitmap.createBitmap(Bitmap.java:684)
at android.graphics.Bitmap.createBitmap(Bitmap.java:653)
at com.airbnb.lottie.LottieDrawable.ensureSoftwareRenderingBitmap(LottieDrawable.java:1452)
at com.airbnb.lottie.LottieDrawable.renderAndDrawAsBitmap(LottieDrawable.java:1400)
at com.airbnb.lottie.LottieDrawable.draw(LottieDrawable.java:515)
```
It does not crash if renderMode is hardware.
Fixes#2026
Lottie is supported and developed on nights and weekends. Issues from Lottie sponsors will be prioritized.
Checklist
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:
Screenshots
None
The text was updated successfully, but these errors were encountered: