Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No component found for view with name "RNSVGRect" : latest version used, no peer dependency errors #382

Closed
Torgian opened this issue Jun 23, 2017 · 5 comments

Comments

@Torgian
Copy link

Torgian commented Jun 23, 2017

I've searched and have found similar issues that have been closed in the recent past, but I cannot figure out why I'm getting this issue. Also, there seems to be similar ones, but I get this error with out any peer dependency errors.

When attempting to render the SVG by calling the class, the error gets thrown. Dismissing the error in my iOS simulator will show the SVG viewing area (a box with a red border) but not the filled Rectangle.

ERROR:

`No component found for view with name "RNSVGRect"

-[RCTUIManager createView:viewName:rootTag:props:]
RCTUIManager.m:1007
invoking_
-[NSInvocation invoke]
-[NSInvocation invokeWithTarget:]
-[RCTModuleMethod invokeWithBridge:module:arguments:]
facebook::react::RCTNativeModule::invokeInner(unsigned int, folly::dynamic const&&)
facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&)::$_0::operator()() const
invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_queue_serial_drain
_dispatch_queue_invoke
_dispatch_root_queue_drain
_dispatch_worker_thread3
_pthread_wqthread
start_wqthread`

Code to follow:

package.json
{ "name": "geEnglishApp", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "react": "16.0.0-alpha.12", "react-native": "0.45.1" }, "devDependencies": { "babel-jest": "20.0.3", "babel-preset-react-native": "2.0.0", "jest": "20.0.4", "react-test-renderer": "16.0.0-alpha.12" }, "jest": { "preset": "react-native" } }

sample code with SVG put in for testing purposes. index.ios.js

`/**

Sample React Native App
https://github.com/facebook/react-native
@flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';

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

export default class geEnglishApp extends Component {
render() {
return (

Welcome to React Native!

To get started, edit index.ios.js

Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu

);
}
}

class SvgExample extends Component {
render() {
return (
<Svg
width="200"
height="60"


); } }
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});

AppRegistry.registerComponent('geEnglishApp', () => geEnglishApp);

@Torgian
Copy link
Author

Torgian commented Jun 24, 2017

This is related to Issue #279

I tried following the steps that elainen wrote down, however this did not solve the problem.

Then, I attempted to follow the steps Andregreen wrote. This worked halfway: I didn't get the error, but instead of a circle on a square that is provided in the example code, I got two squares that were the size of the viewing area.

Until this issue is fixed, I am reverting to PNGs for my projects.

@alanbo
Copy link

alanbo commented Jul 4, 2017

For me this solves the problem #387 . Remove “libRNSVG-tvOS.a” in xcode and restart the project. Svg will work just fine.

@coolguy001tv
Copy link

I solved this problem by adding RNSVG.xcodeproj(from node_modules/react-native-svg/ios/) into my rn project.
Then it works on IOS.
I didn't meet any errors following the readme, including react-native link react-native-svg. But it seems that the link failed?

react-native 0.46.0
react-native-svg 5.3.0
react 16.0.0-alpha.12

@msand
Copy link
Collaborator

msand commented Feb 13, 2018

Seems like a linking error. Instructions available in readme now.

@msand msand closed this as completed Feb 13, 2018
@almorak
Copy link

almorak commented Apr 17, 2018

Encounter same problem but solved by:

  1. manually add the libRNSVG.a if linking not work.
  2. remove the libRNSVG-tvOS.a
  3. don't use react-native run-ios, use xcode's build and run instead.

version using:
react-native 0.52.0
react-native-svg 6.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants