question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use local tmp file path for Image.source

See original GitHub issue

I am trying to use a local tmp file for the source of an Image and keep seeing error “Unrecognized tag protocol”

from the docs:

source {uri: string} uri is a string representing the resource identifier for the image, which could be an http address, a local >file path, or the name of a static image resource (which should be wrapped in the >required(‘image!name’) function).

Have tried (giving the image explicit height and width)

<Image style={styles.thumb} source={{uri:"/var/mobile/Containers/Data/Application/5938C9F8-0A9D-40DD-AB9F-CD2C772439E7/tmp/thumbimage_8gVFD"}} />

<Image style={styles.thumb} source={{uri:"file:///var/mobile/Containers/Data/Application/5938C9F8-0A9D-40DD-AB9F-CD2C772439E7/tmp/thumbimage_8gVFD"}} />

<Image style={styles.thumb} source={require("image!"+"/var/mobile/Containers/Data/Application/5938C9F8-0A9D-40DD-AB9F-CD2C772439E7/tmp/thumbimage_8gVFD"} />

Loading web assets or static image resource works just fine.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

23reactions
mattotoddcommented, Apr 8, 2015

Found the answer, need to pass isStatic to the source of the image.

I feel this should be added to the Image docs

<Image style={styles.thumb} source={{isStatic:true, uri:"/var/mobile/Containers/Data/Application/5938C9F8-0A9D-40DD-AB9F-CD2C772439E7/tmp/thumbimage_8gVFD"}} />
8reactions
PimDeWittecommented, Jul 11, 2016

For anyone coming here looking to solve the android file loading issue, you need to put file:// in front of your file on android

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native Unable to use local tmp file path for Image ...
The image file in your project folder and requiring it. import Logo from '..' // set image path <Image source={ ...
Read more >
iOS : React native Unable to use local tmp file path for Image ...
iOS : React native Unable to use local tmp file path for Image. source iOS [ Beautify Your Computer ...
Read more >
React native Unable to use local tmp file path for Image ...
The image file in your project folder and requiring it. import Logo from '..' // set image path <Image source={require(Logo)} />. Prabhu ...
Read more >
"All of the possible directories for storing temporary files either ...
The Windows TEMP folder or AutoCAD temporary file folders is full. ... Excessive images have been stored up from the PDFIMPORT command.
Read more >
Create a custom WorkSpaces image and bundle
All application services running on the WorkSpace must use a local system ... If you've reached this quota, new attempts to create an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found