The TL;DR question summary: My Android app tries to write to the app\'s external storage directory on an SD card. It fails with a permi
I've learned more about this issue, and it's different enough from CommonsWare's answer that I think it's worth a new answer.
/Android/data/com.example.myapp
folder on it that was not created on this phone, then the app might have trouble getting permission to write to that folder. Whereas if the folder did not exist, the app could create it, and write to it. At least in KitKat and later.
... starting with API Level 19 [KitKat], READ_EXTERNAL_STORAGE was no longer required to access files located on external storage – provided the data folder created by the FUSE daemon matches the app’s package name. FUSE would handle synthesizing the owner, group, and modes of files on external storage when an application is installed [emphasis added].
context.getExternalFilesDirs(null)
in order for the /Android/data/com.example.myapp
folder to be created on the SD card. (At least, on Android 5.1 Lollipop and later. Need to test that on KitKat.)