Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
rockstar1
Level 7

Unable to read .json file in Roku

Hi, from past hours I am trying to read a file from my Roku code, but its unable to read the same.
The path is "pkg:/feed/ads_nonstandard.json", and the file is there at the location also, but when I ReadAsciiFile(filePath), it always return "Unable to read file" error. I even try to see its existence using
LocalFileBrowser = CreateObject("roFileSystem")
print (LocalFileBrowser.exists("pkg:/feed/ads_nonstandard.json"))
but this always return me false. I don't know what is wrong with this, but when i create a xml using eclipse New-> Brightscript Component xml file, the file gets created and LocalFileBrowser shows me true, its true for all the images as well, but not for my .json or .txt file. I have changed the access rights as well for the file, but still I am unable to read my json. Please help!!!!!
0 Kudos
1 Reply
belltown
Level 7

Re: Unable to read .json file in Roku

Have you checked your package's .zip file to see that your Json file is actually there?

I'm not familiar with Eclipse; I was never able to get it to work. However, it may have a setting where you specify which folders are included in your project's package. Make sure that the /feed folder is included -- or just put it in another folder that you know works (e.g. /xml).
https://github.com/belltown/
0 Kudos