Error when plotting on RStudio: Error in RStudioGD() : Shadow graphics device error: r error 4 (R code execution error)

Hello everyone!

I am trying to plot something simple in Rstudio and this error shows up:

> plot(cars)
Error in RStudioGD() : 
  Shadow graphics device error: r error 4 (R code execution error)
Además: Warning messages:
1: In grDevices:::png("C:/Users/Usuario/AppData/Local/Temp/RtmpuYmueE/bcbe775221654e0e80c35484134dae4c.png",  :
  unable to open file 'C:/Users/Usuario/AppData/Local/Temp/RtmpuYmueE/bcbe775221654e0e80c35484134dae4c.png' for writing
2: In grDevices:::png("C:/Users/Usuario/AppData/Local/Temp/RtmpuYmueE/bcbe775221654e0e80c35484134dae4c.png",  :
  opening device failed 

Plus everytime I start a new session this message appears in the console: Graphics error: Plot rendering error

I tried updating R and Rstudio, and the problem is still there. I also manually installed the R tools manually and it still does not work. I have also tried installing an older version of RStudio and the error persists.

It's important to say that R works fine for me, it's RStudio that is giving me problems...

I am working on Windows, if it makes any difference.

Any help would be welcome, I'm in complete loss.

> capabilities()
       jpeg         png        tiff       tcltk         X11        aqua    http/ftp     sockets      libxml        fifo      cledit       iconv         NLS 
       TRUE        TRUE        TRUE        TRUE       FALSE       FALSE        TRUE        TRUE        TRUE        TRUE        TRUE        TRUE        TRUE 
    profmem       cairo         ICU long.double     libcurl 
       TRUE        TRUE        TRUE        TRUE        TRUE 

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=Spanish_Spain.1252  LC_CTYPE=Spanish_Spain.1252    LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C                   LC_TIME=Spanish_Spain.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] installr_0.22.0 stringr_1.4.0  

loaded via a namespace (and not attached):
 [1] ps_1.4.0          fansi_0.4.1       prettyunits_1.1.1 crayon_1.3.4      assertthat_0.2.1  R6_2.5.0          magrittr_2.0.1    stringi_1.4.6     cli_2.1.0        
[10] rstudioapi_0.13   callr_3.5.1       tools_4.0.3       glue_1.4.2        compiler_4.0.3    processx_3.4.4    pkgbuild_1.1.0