To manually grant permission in the app settings is of course not a solution, so try my blocks. They should work …
But, if the update for targetSdkVersion = 30
(Android 11) is available (which actually should already be the case) , it is no longer possible to ask for WRITE
permissions.
See also here.