Open berpcor opened 5 years ago
add this code android.disableResourceValidation=true
in android/gradle.properties
I have same issue
It worked for me, thanks
Update: didn't work, the android doesn't load the SVG files!
Error Android: Using SVG in res leads to an error: “The file name must end with .xml or .png”
use this chunk of code in gradle.properties as well as in build.gradle project level
defaultConfig { versionCode 1 versionName "1.0" vectorDrawables.useSupportLibrary = true }
android.disableResourceValidation=true
the error still existed.
Some people say we have to use react-native-svg for Android, damn. Would be nice to have a fix for this.
Any fix for this issue yet?
God i am searching for this issue and seeing threads which are older then my late grandfather. Still unresolved. I have used ImageView and this error is popping up for an image I am using.
I ended up using react-native-svg-uri-reborn. Had to make some modifications to it because it was adding a black background fill by default, the owner calls it "reborn", promises more support than this github, and disappears for months without even replying. For Android what i did was using svgXmlData={svgString}. It lets you add a direct SVG string. So Android won't bother again.
if 'android' === Platform.OS ? i use svgXmlData={svgString}, otherwise i use normal source={path}
add android.disableResourceValidation=true in android/gradle.properties is work for me.
'inlining' the svg works for me, using react-native-svg
My problem is: I generate apk in Android studio and get error "The file name must end with .xml or .png". The problem connected to files I add to the page using (import SvgUri from 'react-native-svg-uri';) tag. Those are the only files that has extension of svg in drawable-mdpi folder.
What to do? Is this problem connected to your library or not?