For me, the issue occurred because the project's Windows build file was running in the background. I had to end the task in Task Manager, and then it worked.