Getting path of resource directory doesnt work on device but works on simulator

I have an issue with reading files from the resource directory. Its all fine when I launch the program on simulator, but on my device (Samsung Galaxy S III) I get an error telling that function system.pathForFile() returns nill.

I can add that Im only trying to get path to the folder to list files in it, not to get to a specyfic file.

Not sure if this is what you’re running into, but the Android file system is a bit quirky, take a look at this for some more info:

essentially, there is a real file system on the simulator, but Corona is providing a file-system-like interface to the ResourceDirectory on Android (it lives inside the apk, so there isn’t a real path to return to you).  Most/all of the Corona functions “magically” work with files in any directory, but if you try to grab a 

The general suggestion is that if you need a real path to those files, you should copy them into another directory when the app is first launched.

There is a work around in this old thread:

https://forums.coronalabs.com/topic/56020-systempathforfile-returns-wrong-folder-for-resourcedirectory-on-os-x/

Right at the top.

Not sure if this is what you’re running into, but the Android file system is a bit quirky, take a look at this for some more info:

essentially, there is a real file system on the simulator, but Corona is providing a file-system-like interface to the ResourceDirectory on Android (it lives inside the apk, so there isn’t a real path to return to you).  Most/all of the Corona functions “magically” work with files in any directory, but if you try to grab a 

The general suggestion is that if you need a real path to those files, you should copy them into another directory when the app is first launched.

There is a work around in this old thread:

https://forums.coronalabs.com/topic/56020-systempathforfile-returns-wrong-folder-for-resourcedirectory-on-os-x/

Right at the top.