troZee / react-native-svg-view

MIT License
20 stars 2 forks source link

requireNativeComponent: "SvgView" was not found in the UIManager #10

Closed KonstntinM closed 3 years ago

KonstntinM commented 3 years ago

Hello everyone,

first of all thank you for developing the package. While experimenting with the package, I ran into a bug that I can't explain. When I include the package exactly as in the example, I get the following error: "requireNativeComponent: "SvgView" was not found in the UIManager."

error message

Error screen on the test device

code

My code looks like this.

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

import SvgView from 'react-native-svg-view'

export default function NavigationBar() {
  return (
    <View style={styles.container}>
      <SvgView source="https://www.dropbox.com/s/d1dbdvo4l7xry4w/downdogflip.svg?raw=1" style={{ height: 24, width: 24 }}/>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    width: 375,
    height: 80,
    bottom: 0,
    display: 'flex',
    flexDirection: 'row',
    alignItems: 'center',
  },
});

test environment

Have any of you had the same problem? I would be glad to get some feedback.

troZee commented 3 years ago

Hey 👋 Thank you for reporting an issue. What version of lib you are using ? The latest is https://www.npmjs.com/package/react-native-svg-view/v/0.1.6

I checked example in the project and everything works fine

Simulator Screen Shot - iPhone 11 - 2021-01-29 at 15 19 58

troZee commented 3 years ago

I also created a fresh project and everything works fine. Maybe it is related to expo ?

How about an android ? You can also try to go to ios folder and run pod install

KonstntinM commented 3 years ago

Okay, I just tested my project on an Android device as well and got the same error message. I am also using the latest package version (0.1.6) and have reinstalled all packages using expo installer.

I would now also assume that this is a problem with expo.

troZee commented 3 years ago

@KonstntinM Answer is here https://stackoverflow.com/questions/41597414/can-you-add-libraries-with-native-dependencies-to-an-expo-react-native-project

KonstntinM commented 3 years ago

Thanks a lot!