Saving images to the gallery hasn´t been working since Android 10 - display.captureBounds

I realized some time ago that display.captureBounds does not save the image to the gallery when used with this intention on the latest versions of Android. Some of my apps use this option to save an image to the gallery, and several users have reported that the image isn’t being saved to the gallery. Everything is implemented correctly. In fact, I’ve tested it, and it works perfectly on older(android < 10) Android versions and even on iOS.

I have included the permission "android.permission.WRITE_EXTERNAL_STORAGE" in build.settings as specified in the documentation.

And to capture the image:
local captureObj = display.captureBounds( imagenDeFondo.contentBounds, true )

This issue has caused AdMob to warn me about a “Site Behavior: Navigation” issue, putting one of my apps at risk of losing ad display privileges, and I have only until October 31 to resolve it.

Hey @Scott_Harrison, could you please check this when you have a moment?

Considering the latest issues on GitHub(#733 and #735), it appears the recent OS updates broke the APIs that involve saving files.

1 Like

They are actually 2 unrelated issues (both reported by me). Bug #735 is something that has happened for years, and was fixed a while ago for display.capture but not display.captureBounds or display.captureScreen.

#733 is the same issue as the one reported here, and I think is something that has been broken for some time - I simply hadn’t needed to use this functionality until recently so hadn’t encountered it until now.

1 Like

Just ran tests and this pull request should fix the issue

2 Likes

Thank you @Scott_Harrison, but I need to correct you on something: the issue doesn’t occur starting from Android 13 onwards, but rather from Android 10.

This has been corrected

1 Like