You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#2466 introduces new getCurrentColor implementation that causes weird crash in Android.
Crash log indicates getCurrentColor of RenderableView doesn't handle case parent is DefsView.
I can't guess how to fix this and tried changing condition if (parent instanceof VirtualView) { to if (parent instanceof VirtualView && !(parent instanceof DefsView)) { but no luck.
FATAL EXCEPTION: main
java.lang.ClassCastException: com.horcrux.svg.DefsView cannot be cast to com.horcrux.svg.RenderableView
at com.horcrux.svg.RenderableView.getCurrentColor(RenderableView.java:142)
at com.horcrux.svg.RenderableView.setupPaint(RenderableView.java:652)
at com.horcrux.svg.RenderableView.setupFillPaint(RenderableView.java:582)
at com.horcrux.svg.RenderableView.draw(RenderableView.java:520)
at com.horcrux.svg.UseView.draw(UseView.java:86)
at com.horcrux.svg.RenderableView.render(RenderableView.java:486)
at com.horcrux.svg.GroupView.drawGroup(GroupView.java:135)
at com.horcrux.svg.GroupView.draw(GroupView.java:91)
at com.horcrux.svg.RenderableView.render(RenderableView.java:486)
at com.horcrux.svg.GroupView.drawGroup(GroupView.java:135)
at com.horcrux.svg.GroupView.draw(GroupView.java:91)
at com.horcrux.svg.RenderableView.render(RenderableView.java:486)
at com.horcrux.svg.GroupView.drawGroup(GroupView.java:135)
at com.horcrux.svg.GroupView.draw(GroupView.java:91)
at com.horcrux.svg.RenderableView.render(RenderableView.java:486)
at com.horcrux.svg.SvgView.drawChildren(SvgView.java:335)
at com.horcrux.svg.SvgView.drawOutput(SvgView.java:281)
at com.horcrux.svg.SvgView.onDraw(SvgView.java:134)
at android.view.View.draw(View.java:23889)
at com.facebook.react.views.view.ReactViewGroup.draw(ReactViewGroup.java:970)
at android.view.View.updateDisplayListIfDirty(View.java:22756)
at android.view.View.draw(View.java:23620)
at android.view.ViewGroup.drawChild(ViewGroup.java:4556)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:1029)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:980)
at android.view.View.draw(View.java:23892)
at com.facebook.react.views.view.ReactViewGroup.draw(ReactViewGroup.java:970)
at android.view.View.updateDisplayListIfDirty(View.java:22756)
at android.view.View.draw(View.java:23620)
at android.view.ViewGroup.drawChild(ViewGroup.java:4556)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:1029)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:980)
at android.view.View.updateDisplayListIfDirty(View.java:22747)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4540)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4513)
at android.view.View.updateDisplayListIfDirty(View.java:22712)
at android.view.View.draw(View.java:23620)
at android.view.ViewGroup.drawChild(ViewGroup.java:4556)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:1029)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:980)
at com.shopify.reactnative.flash_list.AutoLayoutView.dispatchDraw(AutoLayoutView.kt:34)
at android.view.View.updateDisplayListIfDirty(View.java:22747)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4540)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4513)
at android.view.View.updateDisplayListIfDirty(View.java:22712)
at android.view.View.draw(View.java:23620)
at android.view.ViewGroup.drawChild(ViewGroup.java:4556)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317)
at android.view.View.draw(View.java:23892)
at android.widget.ScrollView.draw(ScrollView.java:1971)
at com.facebook.react.views.scroll.ReactScrollView.draw(ReactScrollView.java:670)
at android.view.View.updateDisplayListIfDirty(View.java:22756)
at android.view.View.draw(View.java:23620)
at android.view.ViewGroup.drawChild(ViewGroup.java:4556)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:1029)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4317)
mym0404
changed the title
[Android] getCurrentColor crash DepsView + Use
[Android] getCurrentColor crash DepsView + Use, java.lang.ClassCastException: com.horcrux.svg.DefsView cannot be cast to com.horcrux.svg.RenderableView
Oct 30, 2024
Description
#2466 introduces new
getCurrentColor
implementation that causes weird crash in Android.Crash log indicates
getCurrentColor
ofRenderableView
doesn't handle case parent isDefsView
.I can't guess how to fix this and tried changing condition
if (parent instanceof VirtualView) {
toif (parent instanceof VirtualView && !(parent instanceof DefsView)) {
but no luck.Steps to reproduce
svg
use
SvgXml
xml
prop for rendering.Snack or a link to a repository
https://snack.expo.dev/@mj-studio/svg-error-reproduce
Note
I can't reproduce with snack because it doesn't support
15.8.0
yet. But it seems clear how to reproduce it.SVG version
15.8.0
React Native version
0.76
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native
Architecture
Paper (Old Architecture)
Build type
Debug app & dev bundle
Device
Android emulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: