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.

Uri issue [Android & IOS]

See original GitHub issue

Description

I realized when you are getting URI directly from camera when you take a picture or record a video, you receive a slightly different URI than you usually do. I’m using react-native-image-picker to pick an image or a video to upload to the server. On android side: I usually receive URI:

“content://media/external/video/media/212”

something like this. (Selecting an image or video from gallery and selecting a video just recorded with the camera image-picker provided) Except when I select an image just taken by the camera image-picker provided gives me an URI:

“content://com.APPNAME.provider/app_images/Pictures/ImageName.jpg”

Basically:

Android side

Image from Gallery /URI/ : Working for me
Video from Gallery /URI/ : Working for me
Image from Camera /URI/ : Not working for me
Video from Camera /URI/ : Working for me

IOS side

Image from Gallery /URI/ : Working for me
Video from Gallery /URI/ : Working for me
Image from Camera /URI/ : Working for me
Video from Camera /URI/ : Not Working for me
URI: "content://media/external/video/media/212" - Works
URI: "content://com.APPNAME.provider/app_images/Pictures/ImageName.jpg" - Doesn't work 

Solution

I’m not so sure if it’s a bug or it supposed to be work like that. My guess is, second URI is like temporary path. That’s why it can’t find the media file.

Additional Information

  • React Native version: 0.44.0
  • React Native Image Picker version: “^0.26.2”,
  • Platform: Both
  • Development Operating System: MacOS
  • Dev tools: Visual Studio Code.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

8reactions
szczepcio95commented, Dec 19, 2017

Hey, just found this on rnfFetchBlob issues set cameraRoll to true

ImagePicker.launchCamera({
      noData: true,
      storageOptions: {
        cameraRoll: true,
        waitUntilSaved: true,
      },
    }
})
0reactions
sanjeevksecommented, Jan 14, 2021

Any solutions for this. I am still getting the issue ‘content://’

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uri issue [Android & IOS] #646 - GitHub
I realized when you are getting URI directly from camera when you take a picture or record a video, you receive a slightly...
Read more >
React Native: uri image not showing on android but perfectly ...
I am fetching some images from an API and displaying them as a flat-list. The problem is that these images show perfectly on...
Read more >
Sending simple data to other apps - Android Developers
The Android Sharesheet is primarily designed for sending content outside your app and/or directly to another user. For example, sharing a URL with...
Read more >
[BUG] URI to open vault not working correctly - Obsidian Forum
I want to use an iOS shortcut to launch a specific vault, but this problem prevents me from doing so. 1 Like.
Read more >
Google Maps Intents for Android | Maps URLs
On this page · Overview · Intent requests. URL encoded query strings · Displaying a map · Searching for a location. Categorical search;...
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