Friday, July 26, 2013

[android-developers] Unable to create "archives" folder using mkdirs.

Once in a while I see problems that are just weird.

A customer said that certain functionality was failing. We put in an explicit check to see if we were failing to do something basic, create a folder.

Now they get a message instead of a more silent or confusing failure.

Unable to create folder: /storage/sdcard1/navigator/<apname>/archives

            File archiveDir = new File(" /storage/sdcard1/navigator/<apname>/archives");
            if(!archiveDir.exists()){
                boolean success = archiveDir.mkdirs();

Note that /storage/sdcard1/navigator/<apname>/ is already created (by the app) and has a few or maybe a gazillion other folders under that, also created by mkdirs.

But mkdirs is returning false.

The person went to the file explorer and manually created that folder and a few subfolders under it. The app continued on and worked.

That person had Hisense Sero 7 Pro
Another user reported this, I don't what device model yet.
I expect there will be more since we have only recently shown any such message to users, and suspected it may have failed silently or confusingly before that.

Would some devices be using "archives" as some sort of reserved word on their filesystem?
Why would the user be able to create that folder when the app cannot, given it has already created many peers to it?

Nathan

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate