screenshot with save_png() failing on Android

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By GameVisitor

I am following the standard practice to get a screenshot / screengrab as described here and I am able to save it using save_png() on Desktop / Ubuntu.

However, the same code is failing on Android, Do I need a special permission to save to a system folder ? I am using Godot 3.2

var fullName = OS.get_system_dir( OS.SYSTEM_DIR_PICTURES ) + "/this_is_a_screen_grab.png"
saveErr :12 fullname :/storage/emulated/0/Pictures/this_is_a_screen_grab.png

12 being : ERR_FILE_CANT_OPEN

Just for testing i i use the user folder it works:

var fullName = OS.get_user_data_dir() + "/this_is_a_screen_grab.png"
saveErr :0 fullname :/data/data/org.godotengine.myGame/files/this_is_a_screen_grab.png

However I am unable to find the picture on the test device Huawei…

Any help Appreciated :slight_smile:

:bust_in_silhouette: Reply From: Ertain

From the looks of it, this has been an on-going issue. While the issue has been closed, the latest comment on that issue says that a screenshots can’t be taken with the engine.

Thx for your feedback, but isn’t that an important feature ?
Weird it is not functional on mobile…

GameVisitor | 2020-04-05 15:44

It probably is. But, AFAIK, the issue still hasn’t been fixed (at least on iOS). :-/

Ertain | 2020-04-05 16:27