According to \"developer.android.com\"
If the app targets Android 8.0 (API level 26), the system grants only
READ_EXTERNAL_STORAGE at that time; however, i
UPDATE: See this answer for a better solution
If you get permission denied error even when the permissions are granted and you already implemented permission checks,
Change targetSdkVersion and compilesdkversion from 29 to 28 or any other lower level.