FileNotFoundException: open failed: EACCES (Permission denied)

后端 未结 2 856
梦毁少年i
梦毁少年i 2021-01-18 20:16

In emulator (i use genymotion) it works fine, but when I run it on a real device (my phone is ASUS ZenFone Laser 5.0) throws a filenotfoundexception

java.io.

2条回答
  •  既然无缘
    2021-01-18 20:28

    I suspect WRITE_EXTERNAL_STORAGE overrides the READ_EXTERNAL_STORAGE read permission. If you look into the documentation you'll see that the former also permits reading from storage.

    Try and remove the android:maxSdkVersion attribute and see if that works. I suspect that your device runs an SDK version > 18.

    Check out this answer for more info: https://stackoverflow.com/a/15270626/425238

提交回复
热议问题