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

Viewed 16205

I've already tried using React-native Link as well as Manual linking but the error is still persisting. React-native-svg Version : 8.0.8

10 Answers

I fixed the problem by explicitly installing the corresponding dependency.

yarn add react-native-svg

If on iOS, might try doing a pod install after you have done an npm install

  1. Go to the iOS directory in your project.
  2. Do a pod install
  3. Open xcode and run again.

See discussion and solutions here: https://github.com/react-native-community/react-native-svg/issues/834

react-native link is missing the last step. it is not adding "new SvgPackage()"

Open up `android/app/src/main/java/[...]/MainApplication.java Add new SvgPackage() to the list returned by the getPackages() method. Add a comma to the previous item if there's already something there.

this is a bug and need to be fixed.

and

In iOS this bug appeared in 7.0.2. To fix, in xcode go to Your_Project / Build Phases / Link Binary With Libraries and add "libRNSVG.a"

running npx pod-install should solve it.

Import package at MainApplication.java

import com.horcrux.svg.SvgPackage;

Then add package to list

new SvgPackage()

The below steps solved my issue.

npm install react-native-svg
npm install react-native-svg-transformer

Uninstall your exist app

react-native-run-android

I hope, It will help someone.

you don't need to add any code, just use the command

npx react-native run-android

to run the project again

Should run npx pod-install instead pod install. It worked for me

Reinstall your Android app with yarn by issuing

yarn run android

which is

npx react-native run-android

Related