Build Check-Package fails

Hi, when I click "Build" "Check Package", the RStudio IDE return an error.

Any suggestions? Thanks in advance.

Error: Could not find tools necessary to compile a package
Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.
Execution halted

Exited with status 1.

So I have tried running the recommended function pkgbuild::check_build_tools. The console returns no errors. Also devtools::check() works fine in the console, it's only the IDE that returns errors.

> pkgbuild::check_build_tools(debug=TRUE)
Your system is ready to build packages!

Windows 11
Rstudio 2023.12.0 Build 369
R 4.3.3

Hi @Benjamin_Mazzotta ,

could you run Sys.getenv() and see if you have the entries R_RTOOLS43_PATH or something similar.

You need the toolchain to build the package but R somehow doesn't find the RTOOLS.

Don't know why

pkgbuild::check_build_tools(debug=TRUE)

is working.