Right now I am really stuck on my project targeting newer SDK versions with scoped storage. I have searched and read the community’s posts but still not having a proper outcome when implementing them on my project.
These are the examples that returns “File not found or sharing” or “Error 2001” or the error “storage/emulated/o/…”
How do I solve this problem for newer android devices? (I am using older devices and these blocks still work, while it is not working on my Android 12 phone)
Thank you in advance.
Hope you stay safe and healthy!
You do not need complicated if then else statements to copy a file from the assets to somewhere, just use // together with the filename, the rest will do the extension for you
You forgot to copy to shared storage… you can’t copy to arbitrary directories anymore… just try to copy to /Downloads/yourDirectory instead…
It successfully copying the file but it still cannot share it.
The sharing options pop up on screen asking me where to share, but when I share it, the corresponding app (e.g. WhatsApp, Gmail for me to share the file) implies the file cannot be accessed or sharing failed.