nativescript-imagepicker
nativescript-imagepicker copied to clipboard
Selecting photos doesnt work on Android Q
All latest...
Selecting a photo returns this error:
Asset '/storage/emulated/0/DCIM/Camera/IMG_20190920_122446.jpg' cannot be found.
And doing something like this:
var img = imageSourceModule.fromFile(selected.android.toString());
results in this error:
Error: java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/IMG_20190920_122446.jpg: open failed: EACCES (Permission denied)
Does this have something to do with the new Scoped Storage Framework?
Setting targetSdkVersion to 28 in app.gradle solves this for now. This plugin needs to be updated to use MediaStore, or will break for anyone targeting sdk 29
https://developer.android.com/reference/android/provider/MediaStore
Hi @davecoffin ,
I've checked the demos in this repo and all of them works fine with the Android Q 10.0 (Api 29). Can you share a bit more details about the device/emulator you are using and a sample project where we can reproduce the mentioned issue.
Closing due to inactivity
For anybody that finds this, @dicksmith pointed this out:
Fun fact, if you want nativescript-imagepicker to work on Android 10, gotta target it (API 29) and add this to the application declaration in the manifest:
<application
...
android:requestLegacyExternalStorage="true"
...
</application>
@DimitarTodorov is that what I was missing?
I have the same issue and i am running it on a Xiaomi Mi 9 if that helps. Please reopen this issue, as I can confirm the bug. :(
I have the same issue and i am running it on a Xiaomi Mi 9 if that helps. Please reopen this issue, as I can confirm the bug. :(
the above mentioned fix works on xiaomi mi 9
@leo00723 yes it works. but using legacy storage is not a fix but rather a work around
Any updates on this? I have faced same issue...
This issue still seems to be present.
Still experiencing this issue
@PhilippS93 - Please see Dave's link above: https://github.com/NativeScript/nativescript-imagepicker/issues/309#issuecomment-548869313
This is something Google changed in Android which breaks functionality; to get the old functionality you need to tell it you want it...
@PhilippS93 - Please see Dave's link above: #309 (comment)
This is something Google changed in Android which breaks functionality; to get the old functionality you need to tell it you want it...
Thank you. But this seems to be a temporary solution, right? The plugin needs to be adapted to use scoped storage in the future when targeting Android 11 or newer.
When can the updates be expected? Any other solutions to this problem?
any solution for this issue
I think I have solved the problem. In app.gradle, just add:
compileSdkVersion = 29
It's no longer allowed to use android:requestLegacyExternalStorage="true" if you're targeting Android 11.
From May 5th, I think, we'll no longer be allowed to submit apps with this flag.
any update on this issue for NS 6? we are not able to open see gallery images on android 11
I think this plugin is deprecated and not longer supported in favor of https://github.com/NativeScript/plugins/tree/master/packages/imagepicker