Do you get that same error message? "Error: RStudio not running", or something else.
Note that with width and height, these are in pixels.
With 3x4, you'll probably get an unhelpful warning message about the graphics state.
With the following, I got a nice file saved
library(rstudioapi)
hist(rnorm(100))
savePlotAsImage('screenshot.png',width = 300,height = 400)