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

Can't save image on Android 10 #176

Open
roxteddy opened this issue Sep 10, 2019 · 9 comments
Open

Can't save image on Android 10 #176

roxteddy opened this issue Sep 10, 2019 · 9 comments

Comments

@roxteddy
Copy link

roxteddy commented Sep 10, 2019

Hello,

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

Any idea ?

@roxteddy roxteddy changed the title Can't save image on Android 10 Can't save image on Pixel 3 / Android Q Sep 11, 2019
@xmarkclx
Copy link
Contributor

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
Copy link
Author

roxteddy commented Oct 16, 2019

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 roxteddy changed the title Can't save image on Pixel 3 / Android Q Can't save image on Android 10 Oct 16, 2019
@roxteddy
Copy link
Author

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
Copy link

mingyiyangyarris commented Oct 22, 2019

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>

@codehack26
Copy link

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
Copy link

Any news about that?

@kjetil-pbl
Copy link

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
Copy link

AndroidManifest.xml

<application android:requestLegacyExternalStorage="true"

is work

@roxteddy
Copy link
Author

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.

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

6 participants