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: 
idunno
Visitor

mrss template doesn't work for me

When selecting the mrss template channel from the channel list, the screen stays on the channel list, and the debug terminal says
001: sub Main()
002: categories = LoadConfig()
003:
004: if categories.Count() > 1
005: ShowPosterScreen(categories, "MRSS", "Template")
006: else
007: ShowEpisodeScreen(categories[0], categories[0].shortDescriptionLine1, "")
008: end if
009: end sub
'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in ...AA5GHUiO/pkg:/source/Main.brs(7)

007: ShowEpisodeScreen(categories[0], categories[0].shortDescriptionLine1, "")
Backtrace:
Function main() As
file/line: /tmp/plugin/N...AA5GHUiO/pkg:/source/Main.brs(7)

Local Variables:
global &h0020 rotINTERFACE:ifGlobal
m &h0010 bsc:roAssociativeArray, refcnt=2
categories &h0010 bsc:roArray, refcnt=1


What is causing this? Is there something in the code that I must change from the default coding? I am using eclipse, and there is no error message regarding categories[0].shortDescriptionLine1, if that even is the problem. Any help would be greatly appreciated!
0 Kudos
13 REPLIES 13
RokuChris
Roku Employee
Roku Employee

Re: mrss template doesn't work for me

It sounds like your categories array is empty. Accessing an array with an index that doesn't exist will result in an invalid value. In this case LoadConfig() function. If config.opml doesn't exist or can't be parsed as valid XML or doesn't contain any <outline> elements, that might cause your problem.
0 Kudos
agmark
Visitor

Re: mrss template doesn't work for me

Have you made any changes to the default config.opml file? If you've made changes, you should go back to the default and carefully edit it again.
FYI, the default is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<opml version="1.0">
<body
backgroundColor="#444444"
leftBreadcrumbColor="#00EE00"
rightBreadcrumbColor="#0000EE"
posterScreenTitleColor="#EEEE00"
posterScreenSubtitleColor="#00EE00"
posterScreenSynopsisColor="#EEEEEE"
springboardScreenTitleColor="#00EE00"
springboardScreenSynopsisColor="#EEEEEE"
springboardScreenActorColor="#EEEE00"
springboardScreenDirectorColor="#EEEE00"
springboardScreenDateColor="#EEEE00">
<outline title="TED Talks" subtitle="Ideas worth spreading" img="http://ted.streamguys.net/TEDTalksvideo_tile_144.jpg" url="http://feeds.feedburner.com/tedtalks_video" />
<outline title="Loaded" subtitle="powered by CNET.com" img="http://www.cnet.com/i/pod/images/podcastsHD_loaded_300x300.jpg" url="http://loadedhdpodcast.cnettv.com" />
<outline title="Engadget" subtitle="" img="http://www.blogsmithmedia.com/www.engadget.com/media/engadgetshow_logo.png" url="http://www.engadget.com/engadgetshow_hd.xml" />
</body>
</opml>

After you've confirmed it works with the default config file, you can go into the Main.brs and add a few print statements to make sure it's parsing ok. If you have more than one <outline> lines and you're getting an error on line 7 of Main then you definately have a problem with the code in your config file.
0 Kudos
agmark
Visitor

Re: mrss template doesn't work for me

I should also point out that if your url= line has an invalid character included, you'll need to change it to make it work. The most common problem I've found is the & character. If that's your problem, you can change the & to &amp; and it should parse just fine.
0 Kudos
idunno
Visitor

Re: mrss template doesn't work for me

I am using the mrsstemplate folder included with RokuSDK_v41. The config file looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<opml version="1.0">
<body
backgroundColor="#444444"
leftBreadcrumbColor="#00EE00"
rightBreadcrumbColor="#0000EE"
posterScreenTitleColor="#EEEE00"
posterScreenSubtitleColor="#00EE00"
posterScreenSynopsisColor="#EEEEEE"
springboardScreenTitleColor="#00EE00"
springboardScreenSynopsisColor="#EEEEEE"
springboardScreenActorColor="#EEEE00"
springboardScreenDirectorColor="#EEEE00"
springboardScreenDateColor="#EEEE00">
<outline title="Barely Digital" subtitle="powered by NextNewNetworks.com" img="http://images.nextnewnetworks.com/20fef47ab57507cbba4ac8dd9d54ba1e.jpg" url="http://www.barelydigital.com/mrss" />
<outline title="Loaded" subtitle="powered by CNET.com" img="http://www.cnet.com/i/pod/images/podcastsHD_loaded_300x300.jpg" url="http://loadedhdpodcast.cnettv.com" />
</body>
</opml>

Also, when I first ran the program, the debugger gave me this error:
*** ERROR compiling /pkg:/source/generalUtils.brs:
SUB or FUNCTION defined twice. (compile error &had) in .../pkg:/source/generalUtils.brs(96)
so I commented it out, but then it gave me the same error for another function, so I commented that out (the problem was that there were functions defined both in generalUtils.brs and in the StringUtils.brs and Types.brs files in the common folder), so I was wondering if maybe I am using a faulty version of the template? Is anyone else having this problem or similar?
0 Kudos
bandal
Visitor

Re: mrss template doesn't work for me

Same here. There is a newer template. Pm me and give your e-mail and I will attach the new file mrss_template_1.1.1.zip

DA
0 Kudos
idunno
Visitor

Re: mrss template doesn't work for me

Fixed it. For whatever reason, Eclipse wasn't loading the config.opml file with the rest of the files when I used file export. I moved the config.opml file to the source folder and change the path in the Main.brs folder, and the program ran fine.
0 Kudos
agmark
Visitor

Re: mrss template doesn't work for me

The mrsstemplate version included in the SDK41 package has a lot of duplicate functions included. If I remember, you can remove the generalUtils file and the app will compile ok. There may be a printAA function that you may want to use so keep the file handy just in case but the rest is not needed and most just duplicate functions. I've just stuck with using the mrss_template_1.1.1 or 1.1.2 versions.

I don't use Eclipse so I don't know why the config file wasn't included. Seems strange. Your top level should have a source and image folder and a config and manifest file. if your manifest file was being included then you should be able to also have the config included too. But like I said, I'm not familiar with Eclipse. I'd had good luck with jEdit and more recently I've been using Notepad++. Both are very good editors.

Mark
0 Kudos
malloys
Visitor

Re: mrss template doesn't work for me

"idunno" wrote:
Fixed it. For whatever reason, Eclipse wasn't loading the config.opml file with the rest of the files when I used file export. I moved the config.opml file to the source folder and change the path in the Main.brs folder, and the program ran fine.


Just noticed the above post.

FYI, the eclipse plugin's export (BrightScript Deployment) wizard only selects certain files and directories by default:
The top-level "source" directory, the top-level "images" directory, any gif, jpg, and png image file in any directory or the top-level, and finally, the manifest file.
Any other file must be selected manually in the first page of the export/deployment wizard.
This was done intentionally to avoid including any files in the project used for development or testing but uneeded or unwanted for the running of the channel.

cheers
0 Kudos
Ultramog
Visitor

Re: mrss template doesn't work for me

Hello, I'm having the same problem. Hoping to use the template to generate our app, but the template isn't running.

config.opml is present.

Before removing generalUtils, this is my debug output:

SUB or FUNCTION defined twice. (compile error &had) in .../pkg:/source/generalUtils.brs(96)
------ Manifest does not exist in zip archive ------


=================================================================
An error occurred while attempting to compile the application:

------->Script directory "/source" does not exist in zip archive.
*** ERROR compiling /pkg:/source/generalUtils.brs:
SUB or FUNCTION defined twice. (compile error &had) in .../pkg:/source/generalUtils.brs(96)

After removing it I get this:

------ Manifest does not exist in zip archive ------


=================================================================
An error occurred while attempting to compile the application:

------->Script directory "/source" does not exist in zip archive.


Should I try using SDK 1.1.1? Is that available?
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.