I had the same issue and in addition to previous comments: if the project was moved by copying (e.g. in my case i moved it from intel mac to m4 mac) just remove all the temporary and generated files inside the project folder. After that try to rebuild the project.