If you've gone through all the other solutions and are still getting the same error, the issue might be with where your project is located for Mac users.
If your project is in a folder that is linked to iCloud backup, then it will keep happening.
Move your project to a different location that is not under iCloud backup like: /Users/<your_name>/<project>
I initially had mine in: /Users/<name>/Documents/<project>
. I tried everything but it didn't fix it. Moved it to /Users/<your_name>/<project>
and it worked immediately