I think your code is correct. I think that app home might not exist which seems to me like an omission on our part. Try
fs.mkdir(fs.getAppHomePath()); -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com. Visit this group at https://groups.google.com/group/codenameone-discussions. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/f3871c0e-06b5-4bfe-981d-4794169f7ad1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.