Fatal Error: "R_TempDir" contains spaces

I have installed R and Rstudio but whenever I open the IDE(Rstudio) it gives me the error Fatal Error: "R_tempdir" contains spaces.
Can someone please guide me as to how to solve this problem?

I am having the same problem (R 4.2.1). When I try to open it, I get that error and then it closes the program.

Have you found a a solution?