software-mansion / react-native-svg

SVG library for React Native, React Native Web, and plain React web projects.
MIT License
7.52k stars 1.14k forks source link

Android crashes after install #2491

Closed KorelogicSte closed 1 month ago

KorelogicSte commented 1 month ago

Description

Followed the install steps, and installed react-native-svg-transformer following their steps. iOS works fine and the SVG appears but for Android the app just closes, no error is given in the bundler. So had to use adb logcat and I get:


10-16 12:07:21.688 16778 16778 E AndroidRuntime: Process: com.redbox.management, PID: 16778
10-16 12:07:21.688 16778 16778 E AndroidRuntime: java.lang.IllegalArgumentException: No enum constant com.horcrux.svg.TextProperties.FontStyle.condensed
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at java.lang.Enum.valueOf(Enum.java:300)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.TextProperties$FontStyle.valueOf(TextProperties.java:91)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.FontData.<init>(FontData.java:193)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.GlyphContext.pushNodeAndFont(GlyphContext.java:170)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.GlyphContext.pushContext(GlyphContext.java:213)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.TextView.pushGlyphContext(TextView.java:208)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.TextView.getGroupPath(TextView.java:197)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.TextView.draw(TextView.java:134)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.RenderableView.render(RenderableView.java:442)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.GroupView.drawGroup(GroupView.java:135)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.GroupView.draw(GroupView.java:91)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.RenderableView.render(RenderableView.java:442)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.GroupView.drawGroup(GroupView.java:135)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.GroupView.draw(GroupView.java:91)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.RenderableView.render(RenderableView.java:442)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.SvgView.drawChildren(SvgView.java:335)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.SvgView.drawOutput(SvgView.java:281)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.horcrux.svg.SvgView.onDraw(SvgView.java:134)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.draw(View.java:24627)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23493)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.draw(View.java:24357)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:882)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:855)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23484)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.draw(View.java:24357)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.drawChild(ViewGroup.java:4576)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4337)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.draw(View.java:24630)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.widget.ScrollView.draw(ScrollView.java:2019)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at com.facebook.react.views.scroll.ReactScrollView.draw(ReactScrollView.java:644)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23493)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.688 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4560)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4533)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.View.updateDisplayListIfDirty(View.java:23449)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:694)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:700)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:798)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewRootImpl.draw(ViewRootImpl.java:5313)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4975)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4093)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2718)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9937)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1406)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1415)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.Choreographer.doCallbacks(Choreographer.java:1015)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.Choreographer.doFrame(Choreographer.java:945)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1389)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:959)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:100)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.os.Looper.loopOnce(Looper.java:232)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:317)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:8592)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
10-16 12:07:21.690 16778 16778 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)```

### Steps to reproduce

1. npx react-native init
2. npm i `react-native-svg`
3. npm i `react-native-svg-transformer`
4. Follow both setup steps

### Snack or a link to a repository

https://github.com/kristerkari/react-native-svg-transformer#installation-and-configuration

### SVG version

15.5.0

### React Native version

0.75.4

### Platforms

Android

### JavaScript runtime

None

### Workflow

None

### Architecture

None

### Build type

None

### Device

None

### Device model

_No response_

### Acknowledgements

Yes
github-actions[bot] commented 1 month ago

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?

KorelogicSte commented 1 month ago

I can't produce a repo.

I have removed the react-native-svg-transformer and I still get the same crash: SVG file is: ``export const Logo =

<g fill="none" fill-rule="evenodd">
    <use fill="#FF3B4C" xlink:href="#a"/>
</g>

`;```

DavitVosk commented 3 weeks ago

I used older version to avoid this problem