Error Starting R for Macbookpro 2021 apple silicon (M1)??

Error Information: code 6, The R session failed to start.

Description of issue - I installed the latest R-arm64-4.20 and RStudio-2022.02.1+461, "Prairie Trillium" today, as I have for many years without problems when i use R-x86-4.20 , but RStudio failed to start when I tried to load R-arm64-4.20 on my Macbook pro 2021(M1).

Attempted steps taken to fix - deleted all R versions and reinstalled latest (R-4.1.2-arm64), which I can access outside of RStudio; deleted .Rprofile file, did Sys.which("R") and got message: no matches found: Sys.which(R)

System Information:

  • RStudio Edition: (Desktop or Server) Desktop
  • RStudio Version: 2022.02.1+461
  • OS Version: Monterey 12.3.1
  • R Version: R-4.2.0-arm64
  • Output your diagnostics report (if possible):

RSTUDIO VERSION

`RStudio 2022.02.1+461, "Prairie Trillium" (8aaa5d47, 2022-03-17) for macOS

Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3_1) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.10 Chrome/69.0.3497.128 Safari/537.36`

ERROR MESSAGE

[No error available]

PROCESS OUTPUT

The R session process exited with code 6 .

ERRORS

dyld[9943]: terminating because inserted dylib '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' could not be loaded: tried: '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/hahawang/lib/libR.dylib' (no such file), '/usr/local/lib/libR.dylib' (no such file), '/usr/lib/libR.dylib' (no such file), '/lib/libR.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk-17.0.1+12/Contents/Home/lib/server/libR.dylib' (no such file), '/var/folders/qx/mt4hqxb11ydb2d61h4mbqddc0000gn/T/rstudio-fallback-library-path-aaOrLn/libR.dylib' (no such file), '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/hahawang/lib/libR.dylib' (no such file), '/usr/local/lib/libR.dylib' (no such file), '/usr/lib/libR.dylib' (no such file), '/lib/libR.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk-17.0.1+12/Contents/Home/lib/server/libR.dylib' (no such file), '/var/folders/qx/mt4hqxb11ydb2d61h4mbqddc0000gn/T/rstudio-fallback-library-path-aaOrLn/libR.dylib' (no such file) dyld[9943]: tried: '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/hahawang/lib/libR.dylib' (no such file), '/usr/local/lib/libR.dylib' (no such file), '/usr/lib/libR.dylib' (no such file), '/lib/libR.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk-17.0.1+12/Contents/Home/lib/server/libR.dylib' (no such file), '/var/folders/qx/mt4hqxb11ydb2d61h4mbqddc0000gn/T/rstudio-fallback-library-path-aaOrLn/libR.dylib' (no such file), '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Users/hahawang/lib/libR.dylib' (no such file), '/usr/local/lib/libR.dylib' (no such file), '/usr/lib/libR.dylib' (no such file), '/lib/libR.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk-17.0.1+12/Contents/Home/lib/server/libR.dylib' (no such file), '/var/folders/qx/mt4hqxb11ydb2d61h4mbqddc0000gn/T/rstudio-fallback-library-path-aaOrLn/libR.dylib' (no such file)

OUTPUT

[No output emitted]

RECENT LOG

/Users/hahawang/.local/share/rstudio/log/rsession-hahawang.log 2022-04-25T09:19:01.663667Z [rsession-hahawang] ERROR system error 92 (Illegal byte sequence) [str: 一, len: 3, from: UTF-8, to: ISO8859-1]; OCCURRED AT core::Error rstudio::r::util::(anonymous namespace)::iconvstrImpl(const std::string &, const std::string &, const std::string &, bool, std::string *) src/cpp/r/RUtil.cpp:187; LOGGED FROM: rstudio::core::Error rstudio::session::modules::spelling::(anonymous namespace)::checkSpelling(const json::JsonRpcRequest &, json::JsonRpcResponse *) src/cpp/session/modules/SessionSpelling.cpp:225 2022-04-25T09:19:01.663667Z [rsession-hahawang] ERROR system error 92 (Illegal byte sequence) [str: 一, len: 3, from: UTF-8, to: ISO8859-1]; OCCURRED AT core::Error rstudio::r::util::(anonymous namespace)::iconvstrImpl(const std::string &, const std::string &, const std::string &, bool, std::string *) src/cpp/r/RUtil.cpp:187; LOGGED FROM: rstudio::core::Error rstudio::session::modules::spelling::(anonymous namespace)::checkSpelling(const json::JsonRpcRequest &, json::JsonRpcResponse *) src/cpp/session/modules/SessionSpelling.cpp:225

Hi @oceansdeep, and welcome!

I came across this very issue yesterday, and the workaround posted at: RStudio and R will not start on Mac M1 OS X Monterey - #4 by cmhatche fixed it.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.