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

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
destruk
Level 10

Re: Registry Failed to Read - Runtime Error

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

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
Roku Employee
Roku Employee

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