terikon/cordova-plugin-photo-library

Can't save image on Android 10

roxteddy opened this issue · 9 comments

Hello,

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

Any idea ?

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

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.

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

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>

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?

Any news about that?

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?

AndroidManifest.xml

<application android:requestLegacyExternalStorage="true"

is work

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.