javascript - React-Native-SVG 错误:不变违规:requireNativeComponent:在 UIManager 中找不到“RNSVGGroup”
问题描述
我尝试使用 react-native-svg 在 React-Native 中创建 SVG。我已经设置了一个 React-Native-CLI。
我用谷歌搜索了一下并尝试自己解决它,我发现了一些有用的东西。我尝试 cd ios && pod install。我不知道豆荚是什么,但我用过。我得到这个错误? 这里是控制台
所以我尝试启动我的应用程序并且错误来了。这是我的代码,它会出错。 标题中的错误
import { StyleSheet, Text, View } from 'react-native'
import Svg, { Circle } from 'react-native-svg';
export default class TachoAnzeige extends Component {
style = StyleSheet.create({
circle: {
width: 44,
height: 44,
borderRadius: 44/2
}
});
render() {
return (
<View>
<Svg height="100" width="100">
</Svg>
<Text>CPU_{this.props.cpuid}</Text>
</View>
)
}
}
在 react-native-svg 我看到这很有用。所以这里是react-native info
System:
OS: Linux 5.8 Manjaro Linux
CPU: (4) x64 Intel(R) Core(TM) i5 CPU M 560 @ 2.67GHz
Memory: 235.25 MB / 7.63 GB
Shell: 5.0.18 - /bin/bash
Binaries:
Node: 15.0.1 - /usr/bin/node
Yarn: Not Found
npm: 6.14.8 - /usr/bin/npm
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 29, 30
Build Tools: 28.0.3, 30.0.2
System Images: android-22 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: 1.8.0_265 - /usr/bin/javac
Python: 3.8.6 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: ^16.13.1 => 16.14.0
react-native: 0.63.3 => 0.63.3
npmGlobalPackages:
*react-native*: Not Found
npmGlobalPackages 上的 react-native 已安装 Android studio 也已安装。
解决:在物理电话和模拟器上完成重新安装应用程序。
解决方案
解决方案:
- 我从 Android 设备上卸载了应用程序,然后运行
npx react-native run-android
或根据您的设置,您可以运行 2。react-native run-android
它有效
推荐阅读
- node.js - UnhandledPromiseRejectionWarning: MongoError: Unrecognized pipeline stage name: '$setWindowFields'
- c# - Dropbox.net 获取用户最喜欢的文件夹内容
- r - 更改集群 geom_col 中的填充顺序?
- encryption - 哈希的意义何在?
- angular - Angular - 错误的包版本?
- algorithm - 为什么在恢复最长递增子序列时需要祖先数组?
- wordpress - 手动调用 Gravity Forms Product Add-ons Plugin
- c - 在 C 中计算阶乘“x! = ?”的算法
- mysql - 如何在 MySQL 中选择具有唯一组合的表的所有列?
- php - Pimcore 更新 6.9 到 10 后的 ParameterNotFoundException