cancel
Showing results for 
Search instead for 
Did you mean: 

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

MNema.1
Associate II

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? 

1 ACCEPTED SOLUTION

Accepted Solutions

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

Mohammad MORADI
ST Software Developer | TouchGFX

View solution in original post

1 REPLY 1

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

Mohammad MORADI
ST Software Developer | TouchGFX