Package DLL not found

Since upgrading Rstudio, I keep getting this error:

Error in library.dynam(lib, package, package.lib) :    DLL ‘testthat’ not found: maybe not installed for this architecture?

It’s intermittent- I could use testthat the day before. And it seems to hit packages randomly. Very frustrating. The only solution seems to be to use

renv::paths$cache()
[1] "C:\\Users\\galen\\AppData\\Local/R/cache/R/renv/cache/v5/windows/R-4.4/x86_64-w64-mingw32"

to find the cache, delete that package, and reinstall it.