简体   繁体   English

React-Native-SVG 错误:不变违规:requireNativeComponent:在 UIManager 中找不到“RNSVGGroup”

[英]React-Native-SVG Error: Invariant Violation: requireNativeComponent: "RNSVGGroup" was not found in the UIManager

I Try to create a SVG in React-Native using react-native-svg.我尝试使用 react-native-svg 在 React-Native 中创建一个 SVG。 I have setup a React-Native-CLI.我已经设置了一个 React-Native-CLI。

I google a bit and try to solve it my self and i find something usefull.我谷歌了一下并尝试自己解决它,我找到了一些有用的东西。 I try to cd ios && pod install.我尝试 cd ios && pod install。 I dont know what pod is but i used it.我不知道 pod 是什么,但我用过它。 And i get this error?我收到这个错误? Here the Console这里是控制台

So and i try to start my app and the error come.所以,我尝试启动我的应用程序,但错误来了。 Here My Code that do the Error.这是我的代码,执行错误。 ERROR in the Title标题错误

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>
        )
    }
}

In react-native-svg i see this can be usefull.在 react-native-svg 我看到这很有用。 So here is react-native info所以这里是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

react-native on npmGlobalPackages is installed Android studio is also installed.安装了 npmGlobalPackages 上的 react-native 也安装了 Android studio。

SOLVE: Complete Reinstall the App on the Physical Phone and Emulator.解决:在物理电话和模拟器上完成重新安装应用程序。

Solution:解决方案:

  1. I uninstalled the Application from Android Device and then ran我从 Android 设备卸载了应用程序,然后运行
  2. npx react-native run-android

OR According to your setup you can run 2. react-native run-android根据您的设置,您可以运行 2. react-native run-android

And it works它有效

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不变违规:requireNativeComponent:在 Android 的 UIManager 中找不到“RNSVGSvgViewAndroid” - Invariant Violation: requireNativeComponent: "RNSVGSvgViewAndroid" was not found in the UIManager in Android 不变违规:不变违规:requireNativeComponent:在 UIManager 中找不到“RNCSafeAreaView”。 - Invariant Violation: Invariant Violation: requireNativeComponent: "RNCSafeAreaView" was not found in the UIManager." 反应本机不变违反错误 - React native invariant violation error requireNativeComponent:在 UIManager 中找不到“RNSScreenStackHeaderConfig” - requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager React Native react-native-svg 显示错误 - React Native react-native-svg showing error 在 UIManager 中找不到 requireNativeComponent - requireNativeComponent was not found in UIManager 错误:在 UIManager 中找不到“ARTShape” - React native - Error : "ARTShape" was not found in the UIManager - React native 将 svg 转换为 react-native-svg - Convert svg to react-native-svg 未找到 react-native-svg ForeignObject 元素(React-Native + Expo + TypeScript) - react-native-svg ForeignObject element not found (React-Native + Expo + TypeScript) react-native:获取错误,不变违规:未找到 RNSVGCircle 的查看配置 - react-native: Get error, invariant violation: View config not found of RNSVGCircle
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM