Lv.obj() is not valid C code

What do you want to achieve?

I’d like to compile squareline’s exported code.

What have you tried so far?

I tried exporting an update from my UI engineer, but it contains this line: lv_obj_t * lv.obj();, which is not valid C code, so cannot be compiled.

Screenshot or video


AssistanceSettinsTransfer.zip (19.7 KB)

Others

  • SquareLine Studio version: 1.5.0
  • Operating system: Windows 11
  • Target hardware: Custom PCB with ESP32-S3, IDF5.1.2

It looks like this is caused when a SquareLine component in the project cannot be instantiated for some reason or another is then exported. Ex:

EVAL FAILED: Traceback (most recent call last):
  Internal line 3051, in codestream.py
   ui_CUHomeTransfer1 = ui_CUHomeTransfer_create(ui_CDCLiveHumanGame)
  Internal line 2500, in ui_CUHomeTransfer_create
       cui_AppTile8.set_x(0)
  NameError: name 'cui_AppTile8' isn't defined
Command not send: PKT_IN_TYPE_SCRIPT
Error: LVGL crashed
Please check the console

We’re using components to move pieces of UI from a prototyping environment to our main branch. It looks like this uncompilable export occured when we created a temporary screen-transfer-component to hold all the objects on a screen(including ‘another-component’), transferred it to the new project, unpacked the screen-component, deleted ‘another-component’ definition from inside the screen-component, then exported the project. The screen-transfer-component can no longer be instantiated as one of its dependencies is broken, but the export process exports it still, so then it doesn’t compile.