question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPE at com.airbnb.lottie.model.layer.BaseLayer.intersectBoundsWithMask(BaseLayer.java:349)

See original GitHub issue

Checklist

  1. Fork this repository into your account.
  2. Reproduce your issue in the issue-repro module. Issues without a repro in the issue-repro module may be auto-closed.

Link to fork with a repro in the issue-repro module

Describe the bug

Hello! This report is about a crash that is happening in production and, with a certain frequency, on the Play Store pre-launch reports too. Sadly I’ve never been able to reproduce it locally. Here’s the relevant stacktrace and please let me know if you would like to see more info about the audience of this crash.

java.lang.NullPointerException: Attempt to read from field 'boolean android.graphics.Path.isSimplePath' on a null object reference
	at android.graphics.Path.set(Path.java:106)
	at com.airbnb.lottie.model.layer.BaseLayer.intersectBoundsWithMask(BaseLayer.java:349)
	at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:266)
	at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:120)
	at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:254)
	at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:300)
	at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:120)
	at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:254)
	at com.airbnb.lottie.model.layer.CompositionLayer.drawLayer(CompositionLayer.java:120)
	at com.airbnb.lottie.model.layer.BaseLayer.draw(BaseLayer.java:254)
	at com.airbnb.lottie.LottieDrawable.drawWithOriginalAspectRatio(LottieDrawable.java:1292)
	at com.airbnb.lottie.LottieDrawable.drawInternal(LottieDrawable.java:403)
	at com.airbnb.lottie.LottieDrawable.draw(LottieDrawable.java:393)
	at android.widget.ImageView.onDraw(ImageView.java:1367)
	at android.view.View.draw(View.java:19337)
	at android.view.View.buildDrawingCacheImpl(View.java:18562)
	at android.view.View.buildDrawingCache(View.java:18418)
	at com.airbnb.lottie.LottieAnimationView.buildDrawingCache(LottieAnimationView.java:1085)
	at android.view.View.draw(View.java:19044)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4301)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4085)
	at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1975)
	at android.view.View.draw(View.java:19345)
	at android.view.View.updateDisplayListIfDirty(View.java:18254)
	at android.view.View.draw(View.java:19052)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4301)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4085)
	at android.view.View.updateDisplayListIfDirty(View.java:18245)
	at android.view.View.draw(View.java:19052)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4301)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4085)
	at android.view.View.updateDisplayListIfDirty(View.java:18245)
	at android.view.View.draw(View.java:19052)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4301)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4085)
	at android.view.View.updateDisplayListIfDirty(View.java:18245)
	at android.view.View.draw(View.java:19052)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4301)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4085)
	at android.view.View.updateDisplayListIfDirty(View.java:18245)
	at android.view.View.draw(View.java:19052)
	at android.view.ViewGroup.drawChild(ViewGroup.java:4301)
	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4085)
	at android.view.View.draw(View.java:19345)
	at com.android.internal.policy.DecorView.draw(DecorView.java:792)
	at android.view.View.updateDisplayListIfDirty(View.java:18254)
	at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:678)
	at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:684)
	at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:792)
	at android.view.ViewRootImpl.draw(ViewRootImpl.java:3164)
	at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2964)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2502)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1482)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7124)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1008)
	at android.view.Choreographer.doCallbacks(Choreographer.java:804)
	at android.view.Choreographer.doFrame(Choreographer.java:732)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:994)
	at android.os.Handler.handleCallback(Handler.java:794)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:176)
	at android.app.ActivityThread.main(ActivityThread.java:6662)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

Steps To Reproduce Steps to reproduce the behavior: sadly they are unknown

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
gpealcommented, Nov 4, 2021

@matteinn You can use 4.2.1-SNAPSHOT now or wait for the next patch release which should be coming out soon. This is the safeMode API.

0reactions
matteinncommented, Nov 4, 2021

@gpeal where can I find the documentation about this “safe mode”? Is this a new feature about to be released? From what I see in https://github.com/airbnb/lottie-android/pull/1939 it looks like no changes will be required on consumer apps, besides upgrading to the next SDK version which will contain that PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

BaseLayer.applyMasks NullPointerException #2096 - GitHub
My animation doesn't use any unsupported features. I know what part of my animation doesn't work. I have created a simplified version of...
Read more >
Setting custom font into lottie android - Stack Overflow
Above screenshot is my fonts folder. But when I run the application, it gives error. java.lang.RuntimeException: Font asset not found fonts/Arial.ttf at android ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found