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

Cannot get FileUrl for android.os.Build.VERSION.SDK_INT >= 23 #29

Closed
NicoleZA opened this issue Aug 29, 2016 · 4 comments
Closed

Cannot get FileUrl for android.os.Build.VERSION.SDK_INT >= 23 #29

NicoleZA opened this issue Aug 29, 2016 · 4 comments

Comments

@NicoleZA
Copy link

This plugin does not seem to working for android version 23.
Cannot get FileUrl

@PanayotCankov
Copy link
Contributor

I've reproduced a problem that throws:

JS: Error: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=2346, uid=10054 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()

Perhaps we should investigate any additional permissions that may be required when accessing files.
What files do you upload? The above was reproduced trying to upload an image selected with the nativescript-imagepicker.

@NicoleZA
Copy link
Author

I am just picking any file from my gallery on my phone.
I have tried added different permissions but was unable to figure this one out

@PanayotCankov
Copy link
Contributor

We will check if we can integrate this in the plugin, although the permission is required at the time you try to read the file, not the time you pick the image.

You can try to ask for the permission using the following plugin:
https://www.npmjs.com/package/nativescript-permissions

@PanayotCankov
Copy link
Contributor

fileUri will always be unreliable in both platforms, in some cases there would be insufficient permissions, in others, the images may be still in the cloud and have yet to be downloaded. Please use getImage and getImageData. We are currently working toward making fileUri return simple null instead of crashing. After obtaining and image you can save it in you app temp files for further usage.

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

No branches or pull requests

2 participants