App crashes java.lang.NullPointerException app.rive.runtime.kotlin.fonts.SystemFontsParser$Companion.readFont

Open
#313 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, kotlin, react-native
Domain
mobile

Research direction

Start at SystemFontsParser.Companion.readFont in the stack trace and trace the callers through readLegacyFamily, readXML, and FontHelper.getFallbackFont. Investigate the production path on Oppo and OnePlus devices; done means loading the Rive resource no longer crashes with a NullPointerException there.

Written by the indexing model from the issue text.

Description

Getting a random crash on production, here is the stack trace

java.lang.NullPointerException (crashed)
app.rive.runtime.kotlin.fonts.SystemFontsParser$Companion.readFont (SourceFile:530)
app.rive.runtime.kotlin.fonts.SystemFontsParser$Companion.readLegacyFamily (SourceFile:405)
app.rive.runtime.kotlin.fonts.SystemFontsParser$Companion.readXML (SourceFile:296)
app.rive.runtime.kotlin.fonts.SystemFontsParser$Companion.parseFontsXML$kotlin_release (SourceFile:280)
app.rive.runtime.kotlin.fonts.FontHelper$Companion.getSystemFonts (SourceFile:208)
app.rive.runtime.kotlin.fonts.FontHelper$Companion.getFallbackFont (SourceFile:117)
app.rive.runtime.kotlin.fonts.FontHelper$Companion.getFallbackFontBytes (SourceFile:250)
app.rive.runtime.kotlin.core.File.cppArtboardByIndex (Native Method:0)
app.rive.runtime.kotlin.core.File.artboard (SourceFile:91)
app.rive.runtime.kotlin.core.File.getFirstArtboard (SourceFile:60)
app.rive.runtime.kotlin.controllers.RiveFileController.setupScene$kotlin_release (SourceFile:424)
app.rive.runtime.kotlin.RiveAnimationView$setRiveBytes$2.invoke (SourceFile:798)
app.rive.runtime.kotlin.RiveAnimationView$setRiveBytes$2.invoke (SourceFile:796)
app.rive.runtime.kotlin.RiveAnimationView.loadFileFromResource (SourceFile:421)
app.rive.runtime.kotlin.RiveAnimationView.setRiveBytes (SourceFile:801)
app.rive.runtime.kotlin.RiveAnimationView.setRiveBytes$default (SourceFile:774)
com.rivereactnative.RiveReactNativeView.setUrlRiveResource$lambda$9 (SourceFile:433)
com.rivereactnative.RiveReactNativeView.$r8$lambda$iOANrzy2_jRbdJSEtHNc6Vi4Wog (SourceFile:1)
com.rivereactnative.RiveReactNativeView$$InternalSyntheticLambda$1$5fa9d9510a7fc69678edf03f9514ecad37517b0574dd61d988f3cb9a46d9fde0$0.onResponse (SourceFile:1)
com.rivereactnative.RNRiveFileRequest.deliverResponse (SourceFile:585)
com.rivereactnative.RNRiveFileRequest.deliverResponse (SourceFile:579)
com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run (SourceFile:108)
android.os.Handler.handleCallback (Handler.java:959)
android.os.Handler.dispatchMessage (Handler.java:100)
android.os.Looper.loopOnce (Looper.java:282)
android.os.Looper.loop (Looper.java:387)
android.app.ActivityThread.main (ActivityThread.java:9505)
java.lang.reflect.Method.invoke (Native Method:0)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:600)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1005)

Mostly coming on Oppo and OnePlus.

Dominant language
TypeScript
Stars
783
Forks
81
Avg merge
3d 6h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rive-app/rive-react-native

All issues in rive-app/rive-react-native

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.