recycleBitmaps throw NullPointerException while onDestroy after LottieAnimationView updateBitmap with a null bitmap
See original GitHub issueLottieAnimationView throws NullPointerException while activity onDestoy. Because a bitmap in ImageAssetManager bitmaps is null. I call LottieAnimationView updateBitmap(id, null) because I need clear the bitmap, after this the exception would occur while onDestroy.
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.Bitmap.recycle()' on a null object reference at com.airbnb.lottie.manager.ImageAssetManager.recycleBitmaps(ImageAssetManager.java:96) at com.airbnb.lottie.LottieDrawable.recycleBitmaps(LottieDrawable.java:142) at com.airbnb.lottie.LottieAnimationView.recycleBitmaps(LottieAnimationView.java:277) at com.airbnb.lottie.LottieAnimationView.onDetachedFromWindow(LottieAnimationView.java:269) at android.view.View.dispatchDetachedFromWindow(View.java:15668) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3183) at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3183) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4719) at android.view.ViewGroup.removeViewInternal(ViewGroup.java:4693) at android.view.ViewGroup.removeView(ViewGroup.java:4624) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1205) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1268) at android.support.v4.app.FragmentManagerImpl.dispatchDestroy(FragmentManager.java:2180) at android.support.v4.app.FragmentController.dispatchDestroy(FragmentController.java:271) at android.support.v4.app.FragmentActivity.onDestroy(FragmentActivity.java:386) at android.support.v7.app.AppCompatActivity.onDestroy(AppCompatActivity.java:202)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7

Top Related StackOverflow Question
@usmanrana07 This will be resolved with #1002