Subdirectories in system.ResourceDirectory

Should it be possible to read files in nested subdirectores within the ResourceDirectory?

local path = system.pathForFile( "storage/books/abook/chapters/chapters.xml", system.ResourceDirectory )  

This works in the simulator, but not on my device. It generates a file not found runtime error on the device.

W/System.err(18782): java.io.FileNotFoundException: /data/data/com.test.app/files/coronaResources/storage/books/abook/chapters/chapters.xml (No such file or directory)

I can read the xml file if it’s in the root directory, but for organizational reasons I can’t do that. [import]uid: 4596 topic_id: 9686 reply_id: 309686[/import]

Have you found a solution? I have the same problem, even checked the apk, the files are there, but program gives “file not found” error at runtime. Works just fine in emulator.

Build 2011.574, Android [import]uid: 52103 topic_id: 9686 reply_id: 48090[/import]

Android doesn’t have a file system like the Mac or iOS, so internally we have to play some games to make files visible. Files that are visible to our internal APIs (image, sound, and video) may not be available to the file system APIs. Android also treats certain file types differently too (HTML and maybe XML).

We revamped the way we build the Android APK in the last public release but now need to look at the existing limitations and what we can do to overcome them. We will try to address this as quick as possible and either make some changes or publish the limitations.

One workaround is to try changing the file extension to .txt and see if that makes a different.

Thanks,
Tom [import]uid: 7559 topic_id: 9686 reply_id: 48367[/import]

Thanks for the info, Tom! Txt files with JSON level data were exactly the kind of files that I was trying to load.
Anyways, I’m glad to know know you are working on this. [import]uid: 52103 topic_id: 9686 reply_id: 48402[/import]