Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isRecycled() on a null object reference #2609

Open
benawad opened this issue Jan 13, 2025 · 3 comments
Open

isRecycled() on a null object reference #2609

benawad opened this issue Jan 13, 2025 · 3 comments
Labels
Missing repro This issue need minimum repro scenario

Comments

@benawad
Copy link

benawad commented Jan 13, 2025

Description

I have some users that get this crash report. (Only happens on Android 10)

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.isRecycled()' on a null object reference
    at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:65)
    at android.graphics.BaseCanvas.drawBitmap(BaseCanvas.java:113)
    at android.graphics.Canvas.drawBitmap(Canvas.java:1560)
    at com.horcrux.svg.B.r(SourceFile:252)
    at com.horcrux.svg.B.draw(SourceFile:7)
    at com.horcrux.svg.RenderableView.render(SourceFile:44)
    at com.horcrux.svg.B.r(SourceFile:152)
    at com.horcrux.svg.B.draw(SourceFile:7)
    at com.horcrux.svg.RenderableView.render(SourceFile:44)
    at com.horcrux.svg.SvgView.drawChildren(SourceFile:149)
    at com.horcrux.svg.SvgView.drawOutput(SourceFile:69)
    at com.horcrux.svg.SvgView.onDraw(SourceFile:17)
    at android.view.View.draw(View.java:21618)
    at com.facebook.react.views.view.j.draw(SourceFile:60)
    at android.view.View.updateDisplayListIfDirty(View.java:20483)
    at android.view.View.draw(View.java:21350)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4446)
    at com.facebook.react.views.view.j.drawChild(SourceFile:86)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4205)
    at com.facebook.react.views.view.j.dispatchDraw(SourceFile:24)
    at android.view.View.draw(View.java:21621)
    at com.facebook.react.views.view.j.draw(SourceFile:60)
    at android.view.View.updateDisplayListIfDirty(View.java:20483)
    at android.view.View.draw(View.java:21350)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4446)
    at com.facebook.react.views.view.j.drawChild(SourceFile:86)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4205)
    at com.facebook.react.views.view.j.dispatchDraw(SourceFile:24)
    at android.view.View.draw(View.java:21621)
    at com.facebook.react.views.view.j.draw(SourceFile:60)
    at android.view.View.updateDisplayListIfDirty(View.java:20483)
    at android.view.View.draw(View.java:21350)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4446)
    at com.facebook.react.views.view.j.drawChild(SourceFile:86)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4205)
    at com.facebook.react.views.view.j.dispatchDraw(SourceFile:24)
    at android.view.View.updateDisplayListIfDirty(View.java:20474)
    at android.view.View.draw(View.java:21350)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4446)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4205)
    at android.view.View.draw(View.java:21621)
    at android.widget.ScrollView.draw(ScrollView.java:1869)
    at com.facebook.react.views.scroll.c.draw(SourceFile:48)
    at android.view.View.updateDisplayListIfDirty(View.java:20483)
    at android.view.View.draw(View.java:21350)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4446)
    at com.facebook.react.views.view.j.drawChild(SourceFile:86)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4205)
    at com.facebook.react.views.view.j.dispatchDraw(SourceFile:24)
    at android.view.View.draw(View.java:21621)
    at com.facebook.react.views.view.j.draw(SourceFile:60)
    at android.view.View.updateDisplayListIfDirty(View.java:20483)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4428)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4401)
    at android.view.View.updateDisplayListIfDirty(View.java:20441)
    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:584)
    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:590)
    at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:668)
    at android.view.ViewRootImpl.draw(ViewRootImpl.java:3840)
    at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3648)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2954)

Steps to reproduce

I haven't been able to figure out how to recreate this, but I haven't seen anyone report a crash related to Bitmap.isRecycled() and thought you might have some insight where this could come from.

Snack or a link to a repository

n/a

SVG version

15.10.1

React Native version

0.76.5

Platforms

Android

JavaScript runtime

Hermes

Workflow

Expo Dev Client

Architecture

Paper (Old Architecture)

Build type

Release app & production bundle

Device

Real device

Device model

MAR-LX1A, SM-A207M, CPH1877

Acknowledgements

Yes

@github-actions github-actions bot added the Missing repro This issue need minimum repro scenario label Jan 13, 2025
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@tmgsca
Copy link

tmgsca commented Jan 17, 2025

We're seeing this happen on our end too. No repro steps either unfortunately. Also can confirm that the overwhelming majority is on Android 10 (99.8% of occurrences).

@maximzhemerenko
Copy link

maximzhemerenko commented Jan 17, 2025

I see this crash in my application too
I analysed the code and have potential assumption that function Bitmap.createBitmap returns null in same cases at Android 10, 9 and 8? (android/src/main/java/com/horcrux/svg/GroupView.java line 101 or 106)

What are you thinking about this though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario
Projects
None yet
Development

No branches or pull requests

3 participants