terikon / cordova-plugin-photo-library

Maintainer needed. Please contact if you're using this library in your project
MIT License
149 stars 295 forks source link

Can't save image on Android 10 #176

Open roxteddy opened 4 years ago

roxteddy commented 4 years ago

Hello,

When I try to save an image on Android 10, I get this error message : "ENOENT (No such file or directory)"

Any idea ?

xmarkclx commented 4 years ago

Hi @roxteddy . Could be a problem with weird URLs that dont translate well to a filename/folder on Android.

I remember encountering this issue and making a fix for it on my fork of this plugin.

Check it out on: https://github.com/xmarkclx/cordova-plugin-photo-library-sism

roxteddy commented 4 years ago

Hi @xmarkclx it does not work better with your version. Have you tried it on Android 10 ? Seems like they changed the way and places where we are authorized to write media files. I'm planning on doing my own fork.

roxteddy commented 4 years ago

The easy way would be to add the android:requestLegacyExternalStorage="true" entry to the manifest thru the plugin config.

https://developer.android.com/training/data-storage/files/external-scoped#opt-out-of-scoped-storage

And after that it will ask to completely rework the way we write media files but I miss time for now :S

mingyiyangyarris commented 4 years ago

android:requestLegacyExternalStorage

Hi @roxteddy , have you come across this error msg after adding _android:requestLegacyExternalStorage="true"_

~/platforms/android/app/build/intermediates/merged_manifests/debug/AndroidManifest.xml:35: AAPT: error: attribute android:requestLegacyExternalStorage not found.

I got this error after i put the following into my config.xml file in ionic project. `

`

codehack26 commented 3 years ago

android:requestLegacyExternalStorage

Hi @roxteddy , have you come across this error msg after adding _android:requestLegacyExternalStorage="true"_

~/platforms/android/app/build/intermediates/merged_manifests/debug/AndroidManifest.xml:35: AAPT: error: attribute android:requestLegacyExternalStorage not found.

I got this error after i put the following into my config.xml file in ionic project. <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:requestLegacyExternalStorage="false" /> </edit-config>

Hi @mingyiyangyarris , after adding android:requestLegacyExternalStorage="true" i am getting the same error which you got. Did you find any solution?

fgarcia5 commented 3 years ago

Any news about that?

kjetil-pbl commented 3 years ago

android:requestLegacyExternalStorage

Hi @roxteddy , have you come across this error msg after adding _android:requestLegacyExternalStorage="true"_

~/platforms/android/app/build/intermediates/merged_manifests/debug/AndroidManifest.xml:35: AAPT: error: attribute android:requestLegacyExternalStorage not found.

I got this error after i put the following into my config.xml file in ionic project. <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:requestLegacyExternalStorage="false" /> </edit-config>

Hi @mingyiyangyarris , after adding android:requestLegacyExternalStorage="true" i am getting the same error which you got. Did you find any solution?

I am also getting this error. Have anyone found a fix?

gofunbox commented 2 years ago

AndroidManifest.xml

<application android:requestLegacyExternalStorage="true"

is work

roxteddy commented 2 years ago

I think you get that error because of your compilation API version. Anyway, LegacyExternalStorage is not a solution since we will be forced to use latest API target by september for new apps and november for all aps and they removed this legacy option. we have to find a new solution to save files. Possibly using the Android Media library.