Reputation: 181
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
Upvotes: 17
Views: 42514
Reputation: 11
Tried every solution above...None of them worked. I'm using expo with an eas build. What ended up working at the end was rerunning the build command (mind you this is for ios).
eas build --profile development-simulator --platform ios
Upvotes: 1
Reputation: 159
Using expo, I had installed react-native-svg-transformer using
npm install --save react-native-svg-transformer
(I believe the following command had failed to install the package)
npx expo install react-native-svg-transformer
My app was simply showing a white screen after the initial splash screen.
adb logcat revealed the error message in this post title and the solution posted here, namely to install react-native-svg, worked.
Upvotes: 0
Reputation: 301
if you are using expo:
remove the package that have react-native-svg
as dependency
npm uninstall <package name>
npm expo install <package name>
using expo install allows Expo CLI to pick a compatible version of a library when possible and also warn you about known incompatibilities, more here in docs
Upvotes: 0
Reputation: 253
Install this package https://www.npmjs.com/package/react-native-svg
npm i react-native-svg
npx react-native run-android
Upvotes: 0
Reputation: 2585
Reinstall your Android app with yarn
by issuing
yarn run android
which is
npx react-native run-android
Upvotes: 0
Reputation: 41
you don't need to add any code, just use the command
npx react-native run-android
to run the project again
Upvotes: 4
Reputation: 1285
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.
Upvotes: 6
Reputation: 480
Should run npx pod-install
instead pod install
. It worked for me
Upvotes: 0
Reputation: 19325
I fixed the problem by explicitly installing the corresponding dependency.
yarn add react-native-svg
Upvotes: 25
Reputation: 1979
If on iOS, might try doing a pod install
after you have done an npm install
pod install
Upvotes: 14
Reputation: 31
Import package at MainApplication.java
import com.horcrux.svg.SvgPackage;
Then add package to list
new SvgPackage()
Upvotes: 1
Reputation: 2001
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"
Upvotes: 3