cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE v1.9.0 throws null exception when building project that works in v1.8.0

BStic.2
Senior

Throws this incredibly descriptive error:

Errors occurred during the build.

Errors running builder 'CDT Builder' on project 'App'.

java.lang.NullPointerException

I tried cleaning and re-importing the project, and the error persists. If I go back to v1.8.0, it works fine. Anyone have a work around for this?

1 ACCEPTED SOLUTION

Accepted Solutions
mattias norlander
ST Employee

After some analysis we found the issue. It is a bit of a corner case which effects customers who are migrating projects from any previous version of CubeIDE into 1.9.0. But only if the customer has touched the Output prefix setting.

0693W00000Kbvq3QAB.pngIf this field has been touched, and the user has clicked Apply or Apply and Close, a line will be injected into the .cproject file. This line has changed format in 1.9.0. Actually it can also be one line per build configuration --> potentially several lines!

The line added to CubeIDE 1.8.0 and previous versions:

<outputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.output.1640602458" outputPrefix="foo"/>

(The digits at the end of the id is irrelevant)

If this line exist in your project you will get the null-pointer exception. This is because of a minor change in toolchain integration.

If you were to modify the Output prefix field in CubeIDE 1.9.0 and newer versions the following line will instead be added:

<outputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.output.elf.1640602458" outputPrefix="foo" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.output.elf"/>

This line will work in CubeIDE 1.9.0 and later.

In conclusion we have a break in the format in 1.9.0 vs previous versions.

How to fix the issue in CubeIDE?

  • Remove the faulty line manually from the .cproject-file.
  • If the Output prefix field still is needed, use the GUI to apply your prefix, and a new line will be added into the .cproject-file with the correct format.

Users using this feature AND frequently moving between 1.8.0 or prior version AND the 1.9.0 will still have a headache.

In your case @BStic.2​ you are not using this option at all in your project. Our guess is that you probably just played with this option long time ago then clicked Apply. Then removed your change, clicked Apply. As a consequence you have the line in your .cproject-file with an empty value.

So, assuming that you just clean the line, your project should be running fine in any version of CubeIDE.

Thanks for bringing this corner case defect to our attention!

Let us know if there are more questions.

Internal ticket reference: 124045

View solution in original post

8 REPLIES 8
Julien D
ST Employee

Hi @BStic.2​ ,

Can you share the .log file (workspace/.metadata/.log), hopefully containing a more explicite Java stack trace.

BStic.2
Senior

Sure! Here it is. Thanks for looking.

There is clearly something wrong, we'll get back to you to ask for more details if needed.

Thanks for the report ! In the meantime continue using 1.8.0, apologizes for that.

Thanks!

mattias norlander
ST Employee

Hi,

Could you please provide us with your .project and .cproject file and the .settings folder? Make a zip-file and send it to us for analysis?

If you have more than one project in your workspace, then we would be grateful if we have the files/folders described above for all projects.

You can send it to me as a PM or my e-mail. See my profile.

Sure, I PM'd a zip file of the Eclipse project files to you.

mattias norlander
ST Employee

After some analysis we found the issue. It is a bit of a corner case which effects customers who are migrating projects from any previous version of CubeIDE into 1.9.0. But only if the customer has touched the Output prefix setting.

0693W00000Kbvq3QAB.pngIf this field has been touched, and the user has clicked Apply or Apply and Close, a line will be injected into the .cproject file. This line has changed format in 1.9.0. Actually it can also be one line per build configuration --> potentially several lines!

The line added to CubeIDE 1.8.0 and previous versions:

<outputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.output.1640602458" outputPrefix="foo"/>

(The digits at the end of the id is irrelevant)

If this line exist in your project you will get the null-pointer exception. This is because of a minor change in toolchain integration.

If you were to modify the Output prefix field in CubeIDE 1.9.0 and newer versions the following line will instead be added:

<outputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.output.elf.1640602458" outputPrefix="foo" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.output.elf"/>

This line will work in CubeIDE 1.9.0 and later.

In conclusion we have a break in the format in 1.9.0 vs previous versions.

How to fix the issue in CubeIDE?

  • Remove the faulty line manually from the .cproject-file.
  • If the Output prefix field still is needed, use the GUI to apply your prefix, and a new line will be added into the .cproject-file with the correct format.

Users using this feature AND frequently moving between 1.8.0 or prior version AND the 1.9.0 will still have a headache.

In your case @BStic.2​ you are not using this option at all in your project. Our guess is that you probably just played with this option long time ago then clicked Apply. Then removed your change, clicked Apply. As a consequence you have the line in your .cproject-file with an empty value.

So, assuming that you just clean the line, your project should be running fine in any version of CubeIDE.

Thanks for bringing this corner case defect to our attention!

Let us know if there are more questions.

Internal ticket reference: 124045

Great! Thanks! I was able to compile my project.