问题描述
我是 React Native 的新手,我正在尝试在 macOS 上使用 react-native-chart-kit 构建一个简单的图表世界。
我不断收到这些组件异常错误,经过多次谷歌搜索后我无法弄清楚如何解决。
这里的任何帮助将不胜感激。
[email protected] /Users/xkenneth/Work/myTestReactApp
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
└── [email protected] 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)
解决方法
好的,我想通了。我指定的 macOS 版本太低。
我不得不在我的 Podfile 中将它从 10.13 更改为 10.14,然后执行“pod install”并解决了!