fix(hex): Android crash — drop RadialGradient + SvgText fontFamily#68
Merged
Conversation
…tigations Hero kept crashing on Android even after PR #67's userSpaceOnUse fix. Two known react-native-svg 15.12.1 Android bugs were still being hit: 1. Brush.getVal() NPE on RadialGradient (issue #2940). The native UI thread reads cx/cy/r before SVGLength is resolved → null deref → instant crash. iOS path is different and unaffected. → Removed the radial gradient entirely. Polygon now uses a flat semi-transparent violet fill. Same visual class, zero crash risk. 2. SvgText `fontFamily` lookup against native typeface assets. Fonts loaded via expo-font (e.g. "Manrope_800ExtraBold") register with RN's Text layer but aren't always resolvable by react-native-svg's native Android renderer. → Dropped fontFamily from every SvgText. Kept fontWeight="800" so the labels stay heavy. System sans-serif is close enough. Re-add the gradient and custom font once the upstream Brush.getVal guard lands and we have a font-asset-registration solution for SVG text on Android. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #67's userSpaceOnUse + numeric-coords fix didn't stop the Android crash. Research surfaced two known react-native-svg 15.12.1 Android bugs we were still hitting:
Brush.getVal()NPE onRadialGradient(software-mansion/react-native-svg#2940) — native UI thread readscx/cy/rbefore SVGLength resolves → null deref → instant crash. iOS pipeline is different and unaffected.SvgTextfontFamilylookup vs native Android typefaces — expo-font registers fonts with RN's Text layer, but react-native-svg's native Android renderer reads fromassets/fontsand can crash on a miss.Fix
RadialGradient+Defs/Stopimports entirely. Score polygon now fills with a flatrgba(155,130,255,0.28). Same color family, no gradient — eliminates the NPE source.fontFamily="Manrope_800ExtraBold"from every<SvgText>. KeptfontWeight="800"so labels still feel heavy; system sans-serif is close enough for the chart's small text.Re-adding later
Both can come back when:
Tracking as a follow-up. For now the Hero opens, which is what matters.
Test plan
🤖 Generated with Claude Code