getting sf installation error While Publish Application

Hi Guys
we are having some issues while publishing the application on rconnect

[Connect] /opt/R/3.6.0/lib/R/lib -lR\ninstalling to /opt/rstudio-connect/mnt/app/packrat/lib/x86_64-pc-linux-gnu/3.6.0/00LOCK-sf/00new/sf/libs\n** R\n** inst\n** tests\n** byte-compile and prepare package for lazy loading\nin method for ‘dbWriteTable’ with signature ‘\"PostgreSQLConnection\",\"character\",\"sf\"’: no definition for class “PostgreSQLConnection”\nin method for ‘dbDataType’ with signature ‘\"PostgreSQLConnection\",\"sf\"’: no definition for class “PostgreSQLConnection”\nin method for ‘coerce’ with signature ‘\"Spatial\",\"sf\"’: no definition for class “Spatial”\nin method for ‘coerce’ with signature ‘\"Spatial\",\"sfc\"’: no definition for class “Spatial”\nin method for ‘coerce’ with signature ‘\"sf\",\"Spatial\"’: no definition for class “Spatial”\nin method for ‘coerce’ with signature ‘\"sfc\",\"Spatial\"’: no definition for class “Spatial”\nin method for ‘coerce’ with signature ‘\"XY\",\"Spatial\"’: no definition for class
[Connect]  “Spatial”\nin method for ‘coerce’ with signature ‘\"crs\",\"CRS\"’: no definition for class “CRS”\nin method for ‘coerce’ with signature ‘\"sgbp\",\"sparseMatrix\"’: no definition for class “sparseMatrix”\n** help\n*** installing help indices\n*** copying figures\n** building package indices\n** installing vignettes\n** testing if installed package can be loaded from temporary location\nError: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):\n unable to load shared object '/opt/rstudio-connect/mnt/app/packrat/lib/x86_64-pc-linux-gnu/3.6.0/00LOCK-sf/00new/sf/libs/sf.so':\n  /opt/rstudio-connect/mnt/app/packrat/lib/x86_64-pc-linux-gnu/3.6.0/00LOCK-sf/00new/sf/libs/sf.so: undefined symbol: _Z17CPL_gdalrasterizeN4Rcpp6VectorILi16ENS_15PreserveStorageEEES2_S2_S2_S2_bb\nError: loading failed\nExecution halted\nERROR: loading failed\n* removing ‘/opt/rstudio-connect/mnt/app/packrat/lib/x86_64-pc-linux-gnu/3.6.0/sf’"
[Connect] 2022/03/15 15:21:43.334935398 Error: Command failed (1)
[Connect] 2022/03/15 15:21:43.334958205
[Connect] 2022/03/15 15:21:43.335001124 Failed to run system command:
[Connect] 2022/03/15 15:21:43.335002185
[Connect] 2022/03/15 15:21:43.335011281 	'/opt/R/3.6.0/lib/R/bin/R' --vanilla CMD INSTALL --preclean '/opt/rstudio-connect/mnt/tmp/RtmpD4rc7N/packrat-install-66977e7daddb/sf' --library='/opt/rstudio-connect/mnt/app/packrat/lib/x86_64-pc-linux-gnu/3.6.0' --install-tests --no-docs --no-multiarch --no-demo

Kindly help us to resolve this issue. Thanks

Hello @syedburhan.hassan ! That is an interesting issue!! This looks to me like a system dependency issue on your Connect server (sf is well known for having some finicky system dependency needs).

Are you in contact with the administrator who maintains your Connect environment? I think you will be most productive if you reach out to them and share the sf documentation:

There is also some installation guidance provided by Package Manager here:

https://packagemanager.rstudio.com/client/#/repos/1/packages/sf

(scroll down to system dependencies)

I hope that helps!