Local ImageSource uri (file://) throwing an error, possible bug? #1457
Unanswered
James-Firth
asked this question in
Q&A
Replies: 1 comment 10 replies
-
hey there, Should be doing exactly what you're trying to achieve, if I'm not mistaken. |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to set an image overlay using a local image saved to the device (testing on iOS currently but also need it working on Android).
My code all works when I use remote URLs, but not the local ones!
I'm using Expo's FileSystem (and I'm using the Bare workflow, mapbox is working otherwise).
I tested the same URI with a basic
<Image source={{ uri: 'localuri'}} />
to make sure the file existed and wasn't corrupted ✅ When I use with<MapboxGL.Animated.ImageSource url="localuri">
it errors though!EDIT: My images are downloaded for offline use which is why my
url
is afile://
url and can't be hardcoded via theimport
syntax.Any ideas or suggestions?
I need local images for offline support in my app so this is a dealbreaker if I can't get it working again.
I say "possible bug?" because everything seems like it should be working. I've tried hardcoding in case #1358 was relevant. I also tried implementing the changes they suggested to test just in case.
Example logs
First shows the image url (on the simulator), then it prints the props which I pass to the ImageSource and RasterLayer
Then finally the iOS error.
I get a similar log on-device for the path (though it's appropriately
file://var/mobileContainers/Data/Application/...
)"jamestest" is the id I gave the imagesource
Beta Was this translation helpful? Give feedback.
All reactions