Skip to content
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

File mapUriToFile returns null #492

Closed
furaiev opened this issue Sep 10, 2018 · 3 comments
Closed

File mapUriToFile returns null #492

furaiev opened this issue Sep 10, 2018 · 3 comments

Comments

@furaiev
Copy link

furaiev commented Sep 10, 2018

Hi,
It seems like the method below is depricated and should be replaced with Fileproviders

@dpogue
Copy link
Member

dpogue commented Sep 10, 2018

Maybe #468 addresses this? I admit I'm not especially familiar with Android filesystem stuff, so it hasn't gotten the review it deserves yet

@PabbleDabble
Copy link

PabbleDabble commented Jul 26, 2021

I am also curious about this. I'm using https://github.com/apache/cordova-plugin-media-capture to capture video within my app.
The plugin returns this from the intent after capturing video:
content://com.sec.android.app.camera.files/root/storage/emulated/0/DCIM/Camera/Video-VDO_20210723_130732.mp4
on Android 11, Galaxy Tab A7, which then mapUriToFile returns null
as this line within mapUriToFile yields -1
int columnIndex = cursor.getColumnIndex(LOCAL_FILE_PROJECTION[0]);
which then crashes the plugin with this error getAbsolutePath()' on a null object
So obviously there's probably a null catch missing in the media capture plugin, but I'm wondering if the webview should be able to parse the com.sec.android.app.camera... uri? Or maybe the camera hardware is storing the file in the wrong spot?

I'm looking in to the plugin as well, but I'm wondering if this is correct?

On other Android devices we've tried, it works. Another Android 11 device yields something like content://media/0000-0000/video/media/24513

Edit - It looks like the media-capture plugin people might be aware of this - apache/cordova-plugin-media-capture#215 . I will try and update this if this is the case, so if anyone else gets to here like I did will see the (hopeful) updated plugin.

@breautek
Copy link
Contributor

Closing as obsolete / out-dated.

Too many things has changed between now and 2018. If this issue still persists, please create a new ticket with updated information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants