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

Selecting photos doesnt work on Android Q #309

Open
davecoffin opened this issue Sep 20, 2019 · 18 comments
Open

Selecting photos doesnt work on Android Q #309

davecoffin opened this issue Sep 20, 2019 · 18 comments
Labels

Comments

@davecoffin
Copy link

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?

@project-bot project-bot bot added this to Inbox in Plugins Team Sep 20, 2019
@davecoffin
Copy link
Author

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

@DimitarTodorov
Copy link
Contributor

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.

@tbozhikov
Copy link
Contributor

Closing due to inactivity

Plugins Team automation moved this from Inbox to Done Oct 15, 2019
@davecoffin
Copy link
Author

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?

@flodaniel
Copy link

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. :(

@leo00723
Copy link

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

@flodaniel
Copy link

@leo00723 yes it works. but using legacy storage is not a fix but rather a work around

@vytautas-pranskunas-
Copy link

Any updates on this? I have faced same issue...

@bbroereES
Copy link

This issue still seems to be present.

@PhilippS93
Copy link

Still experiencing this issue

@NathanaelA

This comment was marked as abuse.

@PhilippS93
Copy link

@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.

@Siergiej29
Copy link

When can the updates be expected?
Any other solutions to this problem?

@skmani
Copy link

skmani commented Nov 2, 2020

any solution for this issue

@Siergiej29
Copy link

I think I have solved the problem. In app.gradle, just add:
compileSdkVersion = 29

@fpaaske
Copy link

fpaaske commented Apr 23, 2021

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.

@itsmerockingagain
Copy link

any update on this issue for NS 6? we are not able to open see gallery images on android 11

@PhilippS93
Copy link

I think this plugin is deprecated and not longer supported in favor of https://github.com/NativeScript/plugins/tree/master/packages/imagepicker

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

No branches or pull requests