captureBounds do not save an image to Gallery for Android 10

display.captureBounds it’s not saving to the Gallery for Android 10. I have tested in my new phone Realme c21 (Android 10) and it does not work. My code do work because I’ve tested it before in my old phone (Android 6).

A portion of my code:

local myImageBounds = {
xMin = imagenDeFondo.contentBounds.xMin,
xMax = imagenDeFondo.contentBounds.xMax,
yMin = imagenDeFondo.contentBounds.yMin,
yMax = imagenDeFondo.contentBounds.yMax
}
local captureObj = display.captureBounds( myImageBounds, true )

I also added the following permission in my build.settings file:
“android.permission.WRITE_EXTERNAL_STORAGE”