-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Save file in Android system storage #23004
Comments
Can anyone still reproduce this bug in Godot 3.2.1 or any later release (e.g. 3.2.2-rc4)? If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop. |
I guess there is a similar issue #39414 |
@Constannnnnt These issues have a difference: #39414 is about saving in the app-specific folder, whereas this one is about saving in the user's Documents folder. |
I don't know whole android code for godot, but I got a possible cause.
|
Are any temporary workarounds possible? I really need the ability to somehow save images for my Android project, but save_png fails. |
Before writing to the device (both external and internal card), call the access request logic processing, for example:
|
Thanks to @EXOMODE hint, I was able to implement a minimal mp3 player that is able to access the music files on Android: |
I was happy to help :) Remember that my method only works up to API 28 (inclusive). For API 29 there is an additional solution, for API 30 and future there are still access problems and their solution will require patching the engine. |
Before we talked, I successfully deployed my project to an Android 6 phone (old Nexus 5) and to a Pixel4 with Android 11, where it wouldn't work. |
Duplicate of #38913 |
Godot version:
v3.0.6.stable
OS/device including version:
Ubuntu 14.04
Issue description:
Can't save file in Android system or external storage and gives error
ERR_FILE_CANT_OPEN
.Output:
These permissions are set (which I'm not sure if they're enough):
The text was updated successfully, but these errors were encountered: