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

No component found for view with name "RNSVGCircle"

Open eemebarbe opened this issue 9 years ago • 34 comments

On iOS, only using the example components from the repo. React v. 15.4.2, React-Native v. 0.42.0, and react-native-svg v. 5.1.5

(I did react-native link it)

import Svg, {     
    Circle,
    Ellipse,
    G,
    LinearGradient,
    RadialGradient,
    Line,
    Path,
    Polygon,
    Polyline,
    Rect,
    Symbol,
    Use,
    Defs,
    Stop } from 'react-native-svg';

class PieCircle extends Component{
    static title = 'Draw a Pie shape with circle';
    render() {
        return <Svg
            height="100"
            width="100"
        >
            <Circle
                cx="50"
                cy="50"
                r="40"
                fill="#ddd"
            />
            <Circle
                origin="50, 50"
                rotate="-90"
                cx="50"
                cy="50"
                r="20"
                stroke="#0074d9"
                strokeWidth="40"
                fill="none"
                strokeDasharray="80, 160"
            />
        </Svg>
    }
}

eemebarbe avatar Mar 11 '17 03:03 eemebarbe

up

mariobento avatar Mar 17 '17 15:03 mariobento

I have same problem.

zuckeyM-17 avatar Mar 19 '17 04:03 zuckeyM-17

Any feedback from the creator on this?

vongohren avatar Mar 22 '17 12:03 vongohren

Have the same problem. Did someone find a solution?

ghost avatar Mar 30 '17 13:03 ghost

@YanaKopyshchyk you have to upgrade this svg library. It has been recently released

vongohren avatar Mar 30 '17 16:03 vongohren

how recently @Snorlock ? using "react-native-svg": "^5.1.6" and having the same problem

mariobento avatar Mar 30 '17 16:03 mariobento

Following these issues: https://github.com/react-native-community/react-native-svg/issues/288 ⬇️ https://github.com/react-native-community/react-native-svg/issues/259 They say that it should be fixed in 5.1.6

But i see that im currently using master: "react-native-svg": "github:react-native-community/react-native-svg#master", And it works

vongohren avatar Mar 30 '17 16:03 vongohren

Damn, no luck using master as well! :S

mariobento avatar Mar 30 '17 16:03 mariobento

@Snorlock I have the latest version 5.1.6, but, unfortunately, the problem is still there

ghost avatar Mar 31 '17 09:03 ghost

Thats weird, have you cleared derived data? Done a new pod install? Im pretty sure atleast master works

vongohren avatar Mar 31 '17 09:03 vongohren

I deleted node_modules and reinstalled everything, maybe something wrong with react-native link. @eemebarbe Have you solved this problem? With react-native 0.42.3 works, but not with 0.41.2

ghost avatar Mar 31 '17 13:03 ghost

I never used react-native link. Do you use cocoapods and swift? Or either or, @YanaKopyshchyk?

vongohren avatar Mar 31 '17 16:03 vongohren

I don't use cocoapods and swift. Anyway, I think the problem is in the mismatch of the versions :(

ghost avatar Mar 31 '17 17:03 ghost

@YanaKopyshchyk you solved the problem in any way?

mariobento avatar Apr 10 '17 14:04 mariobento

@mariobento yes, but the problem was not with react-native-svg. I use react-native-maps and everything started working when I updated it to 0.13.0. ( Before the update everything worked except svg, but I had 'build failed' )

ghost avatar Apr 10 '17 15:04 ghost

I had this problem. I didn't remember that I used yarn to install react-native-svg and used brew (Homebrew) to install yarn, but then I updated yarn with brew by running in the terminal "brew upgrade yarn" and then ran "yarn upgrade" to save the new dependencies. After that, everything is working fine in yarn 0.24.4 and [email protected].

I really hope this helps anyone struggling as I did.

cmedinasoriano1 avatar May 14 '17 04:05 cmedinasoriano1

I'm running into this problem as well. Created a new project (react-native init), added react-native-svg, manually linked on iOS, reset the cache, cleared watchman, and tried all of the demos. Both the latest version (5.2.0 at time of writing) and master fail.

Has anyone come up with a solution?

dependencies: react-native: 0.45.0 react: 16.0.0-alpha.12

PS: It's not just RNSVGCircle that doesn't work - all of the named imports have their respective errors. However, just using <Svg /> in the codebase results in the following error in the console:

Warning: Native component for "RNSVGSvgView" does not exist

bendyorke avatar Jun 09 '17 09:06 bendyorke

So the way I got around this problem was by individually importing in each component. import Rect from 'react-native-svg'; import Svg from 'react-native-svg'; import Circle from 'react-native-svg'; etc...

Andregreen avatar Jun 16 '17 17:06 Andregreen

I got the "No component found.." error as well.

I have: react@16.0.0-alpha.12 react-native@0.45.1 react-native-svg@5.2.0

I tried linking and unlinking, reinstalling and restarting all the things. In my case, I noticed this error when running react-native run-ios:

2017-06-20 11:42:47.870 xcodebuild[60263:1870365] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 1267. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.

2017-06-20 11:42:47.873 xcodebuild[60263:1870365] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 1267. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.

2017-06-20 11:42:47.874 xcodebuild[60263:1870365] Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character / at line 1" UserInfo={NSDebugDescription=Unexpected character / at line 1, kCFPropertyListOldStyleParsingError=Error Domain=NSCocoaErrorDomain Code=3840 "Missing ';' on line 1267" UserInfo={NSDebugDescription=Missing ';' on line 1267}}

and in line 1267 in my project.pbxproj I saw:

HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native-navigation/ios/**""$(SRCROOT)/../node_modules/react-native-svg/ios/**";

so I changed it to:

HEADER_SEARCH_PATHS = (
  "$(SRCROOT)/../node_modules/react-native-navigation/ios/**",
  "$(SRCROOT)/../node_modules/react-native-svg/ios/**",
);

Not exactly sure how that happened but it ended up working for me.

elainen avatar Jun 20 '17 16:06 elainen

What eventually worked for me was building and running with Xcode (pressing play in Xcode vs react-native run-ios). After doing that once, react-native run-ios started working. :)

bendyorke avatar Jun 21 '17 17:06 bendyorke