Search code examples
rshinyshinyappsrgdal

Shinyapp.io cannot load rgdal package


I have a shiny app that is working locally, that loads several packages, including rgdal, which is installed locally on my MacOS. When I deploy it on shinyapp.io server it seems like the server cannot find the rgdal installation. I have seen that other people have similar problems with rgdal but I cannot seem to find a way to fix it.

I have tried to reinstall the rgdal package from the terminal but also this does not work.

The error I get when I deploy on the server is:

Error in value[3L] : package or namespace load failed for ‘rgdal’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/opt/R/3.5.0/lib/R/library/rgdal/libs/rgdal.so': /opt/R/3.5.0/lib/R/library/rgdal/libs/rgdal.so: undefined symbol: _ZN10OGRFeature11SetGeometryEP11OGRGeometry Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> Execution halted

How can I install the rgdal package in /opt/R/3.5.0/lib/R/library/rgdal/libs/? My understanding is that this should solve the issue as the server is looking in that folder for the installation.


Solution

  • From within Shinyapps.io , under the app's advanced settings, I unchecked the "Package Cache" and then redeployed. Then it worked. This solution was suggested by the rstudio support team.