NB: I’ve found it essential to add this:
android:requestLegacyExternalStorage=“true”
… and make sure you target 29 or earlier.
Otherwise, even if the user-side permissions are set, your app cannot write to the storage device.
Worked without this on Android SDK 30 with emulator.
Failed until I made this change, on Samsung Galaxy device running Android 10.
Pete
