Skip to main content
MNema.1
Associate II
September 28, 2023
Solved

TouchGFX Designer crush: Object reference not set to an instance of an object.

  • September 28, 2023
  • 1 reply
  • 1346 views

Hello! Please, help me to recover from designer crush.
I open my .touchgfx file in the designer (4.22.0), and it opens fine, but with a yellow dot next to Texts tab. (I re-installed some fonts that were used by the application before). But when I press on the Texts, the Designer closes. The designer log then looks like this:

2023-09-28 11:32:40,191 [23] ERROR TouchGFXDesigner.App: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at TouchGFXDesigner.Main.Project.Texts.CalculateLineHeight.HashLanguageSetting(LanguageSetting languageSetting)
at TouchGFXDesigner.Main.Project.Texts.CalculateLineHeight.Execute()
at TouchGFXDesigner.Main.Project.Texts.FontLineHeightCalculator.Monitor()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

How can I fix it? 
And another question: if .touchgfx get removed from the project, is there a way to "reverse-generate" a .touchgfx file from the files that exist in "generated" folder? 

This topic has been closed for replies.
Best answer by Mohammad MORADI ESFAHANIASL

Hello @MNema.1 ,
I'm sorry, I know it is extremely late to answer now, but I answer anyway just in case.
Probably, there was a confusion between the old fonts and the re-installed versions of it. In that case, you could delete those fonts from your assets folder and also change the fonts from the texts.xlm.
Then, you could delete config, build, and generated folders to force TouchGFX create those files again by regenerating code.
And the answer to your second question is no, the process is exactly the opposite. You can recreate you generated folder from the TouchGFX project, but if your .touchgfx file is deleted or corrupted, then it's not possible to recover it from the generated files. 

I hope this helps

1 reply

ST Employee
December 18, 2023

Hello @MNema.1 ,
I'm sorry, I know it is extremely late to answer now, but I answer anyway just in case.
Probably, there was a confusion between the old fonts and the re-installed versions of it. In that case, you could delete those fonts from your assets folder and also change the fonts from the texts.xlm.
Then, you could delete config, build, and generated folders to force TouchGFX create those files again by regenerating code.
And the answer to your second question is no, the process is exactly the opposite. You can recreate you generated folder from the TouchGFX project, but if your .touchgfx file is deleted or corrupted, then it's not possible to recover it from the generated files. 

I hope this helps