-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build release fail #10
Comments
Hi, I am using this in a production app without issues. Can you provide a sample code repo where I can reproduce this issue? |
the same issue, when I built app, I cant see any svg images, but do everything to documentation |
Can you provide more details? Are you using remote uri that starts with |
@seekshiva |
@matsatit and @Husak93, have you managed to fix the issue? |
@nataschaberg Yes, I change it for WebView component and insert there svg code. I can't wait for long answer with this issue. |
Hi, this library tries to determine the format of image based on file name. If it has I am assuming that when you create a production build, the file name might've gotten mangled.. so this library is not able to determine the correct file type. Can any of you verify this? I don't have a pure RN setup currently (I use expo, which might handle |
@seekshiva I tried to dig around a litte today. So the problem seems to be that resolveAssetSource returns a uri without file extension on release build (in my case it looks like this: {"_packager_asset": true,"width":360,"height":380,"uri":"src_img_img_onboarding00","scale":1}). So the check for match '.svg' fails and it defaults to Image render (RN). I tried to work around this, but I dont seem to get the correct file path to render the image from assets of android project. Do you have any tips on that? |
@Husak93 could you post your code with WebView here? Did you use uri or html for source prop of WebView? I couldn't get it running in my project. |
@nataschaberg Thanks! You could use the
Or
And it will directly use the webview component without doing the check |
import SvgImage from “react-native-remote-svg/SvgImage” This still doesnt work :( |
@jainhitesh90 what issue are you getting? |
I also tried to render an SVG Image using import SvgImage from “react-native-remote-svg/SvgImage” and require a local SVG Image. However the production apk does not render anything. |
I am experiencing the same issue as well. If someone has a solution please post here. |
+1 Works in my debug build and works on my iOS build but when I generate a signed APK for android the image SVG does not render. |
Anyone has a solution or workaround please? |
Here's what I've got: from some preliminary tests I did, this only happens in android while referring to a local svg image within the project. It doesn't happen while trying to show a remote image that is at While running in debug build, local images have a I'm guessing that something about the uri of the local image after creating signed APK is causing the image to not be fetched at all. For eg, if the uri scheme is |
@Santei Don't know if your project allows for this but I ended up uploading the icons I needed to icomoon and then just using react-native-vector-icons for my custom icons. It does require you to run |
react-native-vector-icons is a great option. If you have some sort of an over-the-air mechanism set up for updating app code without releasing new app binary, you would want to think through. As the name of this library might give a hint, this was created to scratch my own itch of not being able to show remote uri svg images within my app. If the svg you are going to use is pretty much known at the time of development, react-native-vector-icons could be a good option. But if you need to show user-generated svg images in the app, you can't know it at the time of development and create font with it at the time of development. In such cases, this library is more useful. |
@seekshiva @sjsn thank you so much for the options. I think I will try out |
@seekshiva When i import it using import SvgImage from “react-native-remote-svg/SvgImage” it doesn't render anything in debug mode as well. |
Hi there, anyone has a working solution for this? |
I also tried that import with no luck. Any way we can help with debugging? |
Anyone have a solution for this problem? |
simple solution, use |
I used the following solution:
|
In general, all the assets are often local. So still there is no solution of this problem, right? |
Someone find any solution for this issue? |
The only solution is to use data URI of the SVG and use it with
|
For me, I changed the following line inside index.js of this package:
to
and now it works. |
@seekshiva - If you don't have time to maintain this library I can fix your code and maintain it. Let me know. |
I'm having the same problem. Did anyone get this to work? |
Dias if you need to display 10 or more svgs this lib won't work regardless of whether or not this bug is fixed. Just fyi whoever wrote it didnt consider performance. We dropped this lib and just decided to display pngs. |
I had the same problem with local svg files (Android release). For me helped: https://github.com/kristerkari/react-native-svg-transformer |
Hey guys! import SvgImage from "react-native-remote-svg"; ******************** NOTE: PUT YOUR SVG INSTEAD OF *********************************** const LOADING_SVG_URI ='data:image/svg+xml;utf8,' |
Hi, when i build apk file with Release mode, so
not render svg file.Thanks.
The text was updated successfully, but these errors were encountered: