I have an Android 7.0 test device and my APK targets = \"targetSdkVersion 22\", with:
UPDATE: See Volker Voecking's answer for a better solution
EDIT: This is simply a workaround for those who don't have time to look for a 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.