1

I am new to React Native and I am trying to build a simple hello world of charting with react-native-chart-kit on macOS.

I keep getting these Component Exception errors that I can't figure out how to resolve after much googling.

Any help here would be much appreciated.

mytestreactapp@0.0.1 /Users/xkenneth/Work/myTestReactApp
├─┬ react-native-chart-kit@6.11.0
│ └── react-native-svg@12.1.1
└─┬ react-native-svg-transformer@0.14.3
  └── react-native-svg@12.1.1 deduped
[Sat Jul 24 2021 08:29:30.511]  ERROR    Invariant Violation: requireNativeComponent: "RNSVGGroup" was not found in the UIManager.

This error is located at:
    in RNSVGGroup (at G.tsx:33)
    in G (at LineChart.js:420)
    in RNSVGGroup (at G.tsx:33)
    in G (at LineChart.js:376)
    in RNSVGGroup (at G.tsx:33)
    in G (at Svg.tsx:202)
    in RNSVGSvgView (at Svg.tsx:197)
    in Svg (at LineChart.js:372)
    in RCTView (at View.js:44)
    in View (at LineChart.js:371)
    in LineChart (at App.js:73)
    in RCTView (at View.js:44)
    in View (at App.js:71)
    in RCTView (at View.js:44)
    in View (at App.js:57)
    in RCTScrollContentView (at ScrollView.js:1224)
    in RCTScrollView (at ScrollView.js:1369)
    in ScrollView (at ScrollView.js:1395)
    in ScrollView (at App.js:48)
    in RCTView (at View.js:44)
    in View (at SafeAreaView.js:42)
    in ForwardRef(SafeAreaView) (at App.js:47)
    in App (at renderApplication.js:45)
    in RCTView (at View.js:44)
    in View (at AppContainer.js:106)
    in RCTView (at View.js:44)
    in View (at AppContainer.js:132)
    in AppContainer (at renderApplication.js:39)

enter image description here

Ken
  • 83
  • 2
  • 7
  • https://github.com/capitalone/react-native-pathjs-charts/issues/102 – Marek H Jul 24 '21 at 13:41
  • @MarekH I am having trouble following that thread and figuring out what to do. Manual linking seems to have been replaced with auto-linking in the latest React Native and the packages I have are many versions ahead of what are shown in that GitHub link. – Ken Jul 24 '21 at 13:57

1 Answers1

1

Ok, I figured it out. My specified version of macOS was too low.

I had to change it from 10.13 to 10.14 in my Podfile and then do "pod install" and it resolved!

Ken
  • 83
  • 2
  • 7
  • Interesting. Does it mean that you were able to use `react-native-svg` (which seems to be used by `react-native-chart-kit`) on MacOS? There were actually some open issues in the repo requesting MacOS support: https://github.com/react-native-svg/react-native-svg/issues/297 https://github.com/react-native-svg/react-native-svg/issues/1426 https://github.com/react-native-svg/react-native-svg/pull/1632 If you can already use it out of the box then it's great. – xji Nov 20 '21 at 09:22
  • Oh, it indeed worked out of the box after I ran `pod install` (the build target in my case is already 10.14). Thanks for the tip! – xji Nov 20 '21 at 10:42