Hi - I am getting this error message quite often.
I don't have Google Drive, which seems to have caused issues for others.
I downloaded Windows Process Explorer and searched for any processes using the .Rmd file (there were none). I then looked for the project directory and found a process for rsession.exe with <project directory>.Rproj.user\B12BF9AEF\source\s-4121B91\lock_file. There were another two processes for rsession.exe with the same PID, one process for rstudio.exe and one for explorer.exe .
Note: I downloaded the Process Explorer from here: https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer
and used the instructions here: https://www.howtogeek.com/128680/how-to-delete-move-or-rename-locked-files-in-windows/
I saved all files, closed down Rstudio, deleted the .Rproj.user folder and reopened. I was free of this message for a few hours but it has now returned.
I wonder if it is something to do with having TortoiseGit or Git Desktop - the project is a subdirectory of a version-controlled directory but I do have .Rproj.user in .gitignore..