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
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
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
pod installSee 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"
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
Reinstall your Android app with yarn by issuing
yarn run android
which is
npx react-native run-android
Install this package https://www.npmjs.com/package/react-native-svg
npm i react-native-svg
npx react-native run-android