React Native SVG - (iOS) Invariant violation: native component for "RNSVGSvgView" does not exist

I am having a problem with the SVG library for React Native running on an iOS simulator.

enter image description here

"dependencies": { 
     "better-fetch": "^1.1.2", 
     "firebase": "^4.8.1", 
     "lodash": "^4.17.4", 
     "react": "16.0.0", 
     "react-native": "0.51.0", 
     "react-native-svg": "^6.0.1-rc.1", 
     "react-redux": "^5.0.6", 
     "redux": "^3.7.2", 
     "redux-logger": "^3.0.6", 
     "redux-thunk": "^2.2.0" 
}

I tried the following to no avail:

npm install react-native-svg --save //(again)
react-native link react-native-svg //(again)
watchman watch-del-all
rm -rf node_modules/ && yarn cache clean && yarn install

enter image description here

+6
source share
1 answer

The image obviously shows that the problem is with the binding. As a result, if automatic linking does not work for you, you can try manual linking. For iOS devices, there is no manual manual guide; however, for iOS it is missing.

But you can follow these steps to manually bind to iOS:

  • Open a project in Xcode

  • ... / node_modules/react-native-svg/ios

  • RNSVG.xcodeproj , XCode.

  • (RNSVG.xcodeproj), libRNSVG.a, RNSVG.xcodeproj > Products)

  • libRNSVG.a " " ( " ", XCode)

:)

+3

All Articles