I just encountered and understood the problem.
I have open some files from CMSIS library into KEIL which lock the files.
Then STM32CubeMX fail to copy the files while generating project.
This can be confirmed looking at STM32CubeMX.log located in ~./.stm32cubemx/STM32CubeMX.log
I have following obvious messages :
2017-02-08 17:15:11,767 [ERROR] ProjectBuilder:2177 - Problem during Copy of File cmsis_armcc.h
2017-02-08 17:15:11,779 [ERROR] ProjectBuilder:2177 - Problem during Copy of File core_cm0plus.h
Closing KEIL instance locking the files fix the issue.
One more remark: just closing the project in Keil5.17 does not help! I had to completely exit that Keil5 instance.
Retrieving data ...