react-native-svg icon indicating copy to clipboard operation
react-native-svg copied to clipboard

Invariant Violation: requireNativeComponent: "RNSVGPath" was not found in the UIManager.

Open cipherwisdom opened this issue 11 months ago • 2 comments

ERROR Invariant Violation: requireNativeComponent: "RNSVGPath" was not found in the UIManager.

This error is located at: in RNSVGPath (created by Path) in Path (created by EyeComponent) in RNSVGGroup (created by G) in G (created by Svg) in RNSVGSvgViewAndroid (created by Svg) in Svg (created by EyeComponent) in RCTView (created by View) in View (created by EyeComponent) in EyeComponent (created by TextInputComponent) in RCTView (created by View) in View in Unknown (created by TouchableOpacity) in TouchableOpacity (created by TouchableOpacity) in TouchableOpacity (created by TextInputComponent) in RCTView (created by View) in View (created by TextInputComponent) in TextInputComponent (created by Login) in RCTView (created by View) in View (created by Login) in RCTView (created by View) in View (created by Login) in Login (created by SceneView) in StaticContainer in EnsureSingleNavigator (created by SceneView) in SceneView (created by SceneView) in RCTView (created by View) in View (created by DebugContainer) in DebugContainer (created by MaybeNestedStack) in MaybeNestedStack (created by SceneView) in RCTView (created by View) in View (created by SceneView) in RNSScreen in Unknown (created by InnerScreen) in Suspender (created by Freeze) in Suspense (created by Freeze) in Freeze (created by DelayedFreeze) in DelayedFreeze (created by InnerScreen) in InnerScreen (created by Screen) in Screen (created by SceneView) in SceneView (created by NativeStackViewInner) in Suspender (created by Freeze) in Suspense (created by Freeze) in Freeze (created by DelayedFreeze) in DelayedFreeze (created by ScreenStack) in RNSScreenStack (created by ScreenStack) in ScreenStack (created by NativeStackViewInner) in NativeStackViewInner (created by NativeStackView) in RNCSafeAreaProvider (created by SafeAreaProvider) in SafeAreaProvider (created by SafeAreaProviderCompat) in SafeAreaProviderCompat (created by NativeStackView) in NativeStackView (created by NativeStackNavigator) in PreventRemoveProvider (created by NavigationContent) in NavigationContent in Unknown (created by NativeStackNavigator) in NativeStackNavigator (created by App) in EnsureSingleNavigator in BaseNavigationContainer in ThemeProvider in NavigationContainerInner (created by App) in App in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer in ratingstar(RootComponent), js engine: hermes

cipherwisdom avatar Mar 14 '24 17:03 cipherwisdom

This may help as it may be related - https://github.com/software-mansion/react-native-svg/issues/2235#issuecomment-2069532093

awongCM avatar Apr 25 '24 06:04 awongCM

I faced the same issue on android the APK install crashes when i access a screen where i used import { LocalSvg } from 'react-native-svg/css'; (react-native-svg v14 with expo) so i downgraded to 13.14.1 & updated the import back to import { LocalSvg } from 'react-native-svg'; and it is working fine rn.

component where i used LocalSvg:

import { styled } from 'nativewind';
import React from 'react';
import { StyleProp, Text, View, ViewStyle } from 'react-native';
import { LocalSvg } from 'react-native-svg';
import { icons } from '@/shared/icons';

export type CustomIconProps = {
    name: keyof typeof icons;
    size?: number;
    color?: string;
    style?: StyleProp<ViewStyle>;
};

const CustomIcon = ({ name, size = 24, color = 'black', style }: CustomIconProps) => {
        const icon = icons[name];
        
        if (!icon) {
            return (
                <View style={style}>
                    <Text>{name} not found</Text>
                </View>
            );
        }
        
        return (
            <LocalSvg
                width={size}
                height={size}
                asset={icon}
                fill={color}
                style={style}
            />
        );
    }

robvan2 avatar Jun 02 '24 12:06 robvan2

Hello @robvan2 @awongCM @cipherwisdom, Can you update the react-native-svg? I couldn't reproduce the issue. Please share the example to reproduce the issue with us if you still have it. Thank you.

bohdanprog avatar Jun 13 '24 06:06 bohdanprog

Hello @robvan2 @awongCM @cipherwisdom, Can you update the react-native-svg? I couldn't reproduce the issue. Please share the example to reproduce the issue with us if you still have it. Thank you.

@bohdanprog I already mentioned the solution to this link page I posted earlier in this thread.

https://github.com/software-mansion/react-native-svg/issues/2235#issuecomment-2069532093

I had to uplift to the latest react-native-sg version and it works fine for me.

awongCM avatar Jun 15 '24 04:06 awongCM

Hello @robvan2 @awongCM @cipherwisdom, Can you update the react-native-svg? I couldn't reproduce the issue. Please share the example to reproduce the issue with us if you still have it. Thank you.

@bohdanprog I already mentioned the solution to this link page I posted earlier in this thread.

#2235 (comment)

I had to uplift to the latest react-native-sg version and it works fine for me.

Thanks. Feel free to open a new issue if someone still has an issue connected with that.

bohdanprog avatar Jun 16 '24 09:06 bohdanprog

"react-native": "0.74.5", "react-native-svg": "15.2.0"

isok

bravekingzhang avatar Aug 12 '24 04:08 bravekingzhang

"react-native": "0.74.5", "react-native-svg": "15.2.0"

isok

You saved my day. I downgraded from 15.7.0 to 15.2.0 it works.

sgwanlee avatar Sep 27 '24 05:09 sgwanlee