question

nph67 avatar image
nph67 asked

Kindle Fire 2nd Generation SD card EACCES (Permission denied)

Hi, I'm getting a ...FileNotFoundException: open failed: EACCES (Permission denied)... error when trying to create files in /mnt/sdcard/Android/data/%PACKAGE_NAME%/files/ on the emulator for the 2nd Generation Fire. The app has the required manifest permissions and the problem does not arise on Kindle Fire HD and KIndle Fire 1st Generation emulators. (And yes, %PACKAGE_NAME% is replaced with the actual package name) Is this a bug in the emulator image only or will the same problem show on real devices? Thanks np
fire tablet
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dixith@Amazon avatar image
Dixith@Amazon answered
That's a good question. Currently we are looking into the issue and will get back to you once we have an update.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dixith@Amazon avatar image
Dixith@Amazon answered
We need a sample code to troubleshoot your issue. To maintain privacy, Please raise a Contact us ( https://developer.amazon.com/help/contactus.html) with your sample code so that we can look into the issue.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nph67 avatar image
nph67 answered
There is nothing special about the code and no need to worry about privacy. new java.io.File(Environment.getExternalStorageDirectory(), "/Android/data/some.package.name/files").mkdirs(); is basically all it takes to trigger the exception. All emulators are set up with the minimum 9mB SD card size. However, if you can not reproduce it and say that it can not be caused by something that is intentionally different on the 2nd Gen Fire then I'll happily attribute it to something specific to my machine (way too many emulators or something) and stop worrying about it. thanks
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Samuel@Amazon avatar image
Samuel@Amazon answered
Hi nph67, Just want to make sure that you have added the below line in your manifest file. " "
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nph67 avatar image
nph67 answered
Would it work on your other emulators without that flag? Yes. See my initial post, permissions are set. But as I said in my last post, it's likely something on my machine. I think we can close this. Thanks
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Samuel@Amazon avatar image
Samuel@Amazon answered
It needs the permission to be given explicitly in Android manifest file. However, I am not able to reproduce this error on my machine for this code with or with out this flag. Please try in your machine and let us know if you still face this issue. Thank you.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.