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: 

ReadAsciiFile retruns empty data on Jsonparsing

Hi everyone,

I am tried to read the JSON file for getting the values and it returns the empty values. I am using eclipse in Ubuntu machine.

I was tried the example given in roku sdk JSONParsing.zip and it was working. But when I tried it in new project it showed the following error.

BRIGHTSCRIPT: ERROR: ParseJSON: Data is empty: pkg:/source/Main.brs(85)
BREAK (runtime error &hf8) in pkg:/source/Main.brs(85)


I was used this code.

CategoryAsString = ReadAsciiFile("pkg:/json/category_list.json")
m.json = ParseJSON(CategoryAsString)
print m.json


Is that I need to add any other plugins or need to check file permissions. But file permissions also given 755 access.

Any help will be much appreciated.

Thank you.
I am using Roku 4 - 4400X Model.
0 Kudos
2 Replies
dcrandall
Level 7

Re: ReadAsciiFile retruns empty data on Jsonparsing

Are you using the plugin for eclipse? I ask because famously it decides it's not going to add files when you first start your day.

You've checked the zip file that the json file is there?
0 Kudos

Re: ReadAsciiFile retruns empty data on Jsonparsing

Hi dcrandall,

Yes. Eclipse not included the json file while zipping. So only the json file are missing.

Everytime While zipping i need to check the json folder is added or not.

Thank you for clarifying this.
I am using Roku 4 - 4400X Model.
0 Kudos