Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 5(HTC) EACCES (Permission denied)

app can't create folder/file on android 5(HTC HTC6525LVW os version: 5.0.1) external storage in directory owned by app.

Parent folder is returned by [getExternalFilesDirs(String type)][1] method.

Sdcard is mounted.

Anyone else having this problem or suggestion how to solve it?

(Unfortunately I don't have this device to test it more)

Edit: From one user I know that prior this bug she encrypted sdcard and then formatted it.

like image 662
Martin Vandzura Avatar asked Jun 12 '15 08:06

Martin Vandzura


1 Answers

Some potential ideas as to what caused it:

  1. If the phone is running in USB Storage mode when connected to your computer you can still deploy/debug like normal but write operations will fail

  2. You were missing a permission: in your manifest file you should check to see if you have <permission name=”android.permission.WRITE_EXTERNAL_STORAGE” >

  3. Permissions in the wrong location: make sure that your permission tag (in manifest) is located outside of the application

  4. Writing to the data folder can cause issues like this so make sure you're writing to sdcard and not data

This is everything I could think of. Hope it helps :)

like image 182
d0nut Avatar answered Oct 10 '22 23:10

d0nut