Trouble with rgl and xquartz...

I am using RStudio 1.2.1578 on MacOS Sierra 10.12.4. I have successfully installed the package rgl; however, whenever I try to load it, I get the following error message:

> library("rgl")
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rgl/libs/':
  dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rgl/libs/, 6): Symbol not found: _inflateValidate
  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rgl/libs/
  Expected in: flat namespace
 in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rgl/libs/
Error: package or namespace load failed for ‘rgl’:
 .onLoad failed in loadNamespace() for 'rgl', details:
  call: NULL
  error: 	Loading rgl's DLL failed. 
	On MacOS, rgl depends on XQuartz, which you can download from

The obvious solution would be to install XQuartz. I have already done so, but no luck. Restarting R, restarting my computer, uninstalling/reinstalling Xquartz, uninstalling rgl, etc. all made no difference. I am completely stumped. Any advice?

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.