Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rockstar1
Visitor

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 1
belltown
Roku Guru

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).
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.