Tobias K.
Tobias K.

Reputation: 31

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. I have setup a 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. I dont know what pod is but i used it. 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. So here is 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.

SOLVE: Complete Reinstall the App on the Physical Phone and Emulator.

Upvotes: 3

Views: 3635

Answers (1)

Pankti Bardolia
Pankti Bardolia

Reputation: 69

Solution:

  1. I uninstalled the Application from Android Device and then ran
  2. npx react-native run-android

OR According to your setup you can run 2. react-native run-android

And it works

Upvotes: 4

Related Questions