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: 
bounce
Newbie

Registry Failed to Read - Runtime Error

I'm getting this error and can't seem to understand why. This is inside a XML file which is the only reason I can think of this not working.
BRIGHTSCRIPT: ERROR: roRegistrySection: class PLUGIN|MARKUP on thread RENDER: pkg:/components/videoexamplescene.xml(136)

BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.

Suspending threads...
Thread selected:  1*   ...onents/videoexamplescene.xml(137)    If sec.Exists(key) Return sec.Read(key)

Current Function:
134:  Function RegRead(key,section=invalid)
135:  If section=invalid section="Default"
136:  sec=CreateObject("roRegistrySection",section)
137:* If sec.Exists(key) Return sec.Read(key)
138:  Return invalid
139:  End Function
'Dot' Operator attempted with invalid BrightScript Component or interface reference. (runtime error &hec) in pkg:/components/videoexamplescene.xml(137)
137: If sec.Exists(key) Return sec.Read(key)
0 Kudos
3 REPLIES 3
destruk
Streaming Star

Re: Registry Failed to Read - Runtime Error

Registry operations are only allowed in a task thread.  extends="task" in your xml.
0 Kudos
bounce
Newbie

Re: Registry Failed to Read - Runtime Error

I am already extending scene. So how would that work? This is what I presently have.


<component name = "VideoExampleScene" extends = "Scene" >


I tried

<component name = "VideoExampleScene" extends = "Scene"  extends="task">
<component name = "VideoExampleScene" extends = "Scene,task" >


But those throw up errors.
0 Kudos
NB_
Roku Guru

Re: Registry Failed to Read - Runtime Error

The diagnostic is confusing, let me decode it:
BRIGHTSCRIPT: ERROR: roRegistrySection: class PLUGIN|MARKUP on thread RENDER: pkg:/components/videoexamplescene.xml(136)

means to say something like
BRIGHTSCRIPT: ERROR: roRegistrySection: creation of a MAIN|TASK-only component failed on RENDER thread: pkg:/components/videoexamplescene.xml(136)"

I believe this - making the message human-readable - was addressed in 7.6, so you must be on 7.5.
Summary: if it's registry you want to use - do it in the main thread or a task thread - not in the render one.
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.