Hi,
Firstly, it is possible to accidentally attempt to flash a project for one MCU onto a different MCU - this can lead to errors from the flash driver. The correct flash driver for the K64 MCU is called FTFE_4K - you can check the debug log to see which flash driver is being used.
Assuming there was no error as described above, I would suggest you attempt to mass erase this part. This process is described in the User Manual for the IDE.
First location the LinkServer GUI Flash Programmer Icon from the ToolBar (it looks like a small MCU). Then be sure to select the Erase flash memory tab, and check the Mass erase radio button as below. Then click OK.
If this also fails, I would next try the third tab 'Resurrect locked Kinetis device'. To use this feature, simply select this tab and click OK.
In both of these cases all data on the flash will be erased.
I hope this helps,
Yours,
MCUXpresso IDE Support