Just in case somebody runs in this issue. Had the same problem with version 6.8.1.
The problem is caused by the default toolchain setting, which is EWARM. If you change to STM32CubeIDE later, the files of EWARM project will not be deleted and are causing above problem.
Workaround - delete all files in folder except the .ioc file. Then open .ioc with MX, select correct toolchain (STM32cubeIDE) and re-generate the project files.