RStudio session aborts when launching Shiny App

I was using R 4.4.0 and RStudio 2024.04.2 when I started experiencing aborted R sessions every time I launched the iSEE app (a Bioconductor package) from RStudio. However, when I run R from the terminal, the app works fine.

I also tried forcing the app to open in a browser using shinyApp(iSEE(), options = list(launch.browser = TRUE)). Sometimes it works, but other times it crashes the session. But it consistently fails when I run it from RStudio.

The issue is that the session crashes immediately, without displaying any error message. So I updated my R version and all CRAN and Bioconductor package, but the problem is still there.

I checked the log file :

2024-09-23T11:18:09.060533Z [rsession-user] ERROR Error parsing client state; LOGGED FROM: void rstudio::r::session::(anonymous namespace)::restoreState(const core::FilePath &, json::Object *) src/cpp/r/session/RClientState.cpp:128

2024-09-23T11:18:09.092148Z [rsession-user] WARNING Skipping source db move from: /Users/path/to/data/.Rproj.user/B83F4416/sources/per/t/._8296DD18-contents to /Users/path/to/data/.Rproj.user/B83F4416/sources/session-2790d62/._8296DD18-contents; LOGGED FROM: void rstudio::session::source_database::supervisor::(anonymous namespace)::attemptToMoveSourceDbFiles(const FilePath &, const FilePath &) src/cpp/session/SessionSourceDatabaseSupervisor.cpp:217

2024-09-23T11:18:14.263443Z [rsession-user] ERROR system error 22 (Invalid argument) [path: /Users/path/to/data/.Rproj.user/B83F4416/sources/session-2790d62/._lock_file]; OCCURRED AT Error rstudio::session::source_database::get(const std::string &, bool, boost::shared_ptr<SourceDocument>) src/cpp/session/SessionSourceDatabase.cpp:706; LOGGED FROM: Error rstudio::session::source_database::list(std::vector<boost::shared_ptr<SourceDocument>> *) src/cpp/session/SessionSourceDatabase.cpp:850

2024-09-23T14:05:45.719355Z [rsession-user] ERROR r error 4 (Error in load(file = path, envir = e) :

bad restore file magic number (file may be corrupted) -- no data loaded

) [errormsg: Error in load(file = path, envir = e) :

bad restore file magic number (file may be corrupted) -- no data loaded

]; OCCURRED AT Error rstudio::r::exec::(anonymous namespace)::evaluateExpressionsUnsafe(SEXP, SEXP, SEXP *, sexp::Protect *, EvalType) src/cpp/r/RExec.cpp:252; LOGGED FROM: Error rstudio::session::modules::rmarkdown::notebook::enqueueChunkOutput(const std::string &, const std::string &, const std::string &, const std::string &, const std::string &) src/cpp/session/modules/rmarkdown/NotebookOutput.cpp:545

The problem happens within every Rproj I have and is not limited to a specific folder or data.

I would appreciate any tips or guidance on how to address this issue.

System details:

RStudio Edition : Desktop
RStudio Version : 2024.04.2+764
OS Version      : MacOS Ventura 13.6
R Version       : 4.4.1