Build exited with non-zero status: 1 Execution halted

Hi All,

The below code is working perfectly on my local machine. But when I am trying to deploy it on shinyapps.io I am getting the below error

Preparing to deploy document...DONE
Uploading bundle for document: 8420814...DONE
Deploying bundle: 6892316 for document: 8420814 ...
Waiting for task: 1276992194
building: Building image: 8159119
building: Building package: opencv
################################ Begin Task Log ################################
[2023-02-27T11:50:11.302534020+0000] Installing R package: R6 (2.5.1)

  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘R6’ ...
  • DONE (R6)
    [2023-02-27T11:50:11.659138913+0000] Installing R package: Rcpp (1.0.10)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘Rcpp’ ...
  • DONE (Rcpp)
    [2023-02-27T11:50:12.884494616+0000] Installing R package: base64enc (0.1-3)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘base64enc’ ...
  • DONE (base64enc)
    [2023-02-27T11:50:13.223574273+0000] Installing R package: cli (3.6.0)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘cli’ ...
  • DONE (cli)
    [2023-02-27T11:50:13.656809325+0000] Installing R package: commonmark (1.8.1)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘commonmark’ ...
  • DONE (commonmark)
    [2023-02-27T11:50:14.061272998+0000] Installing R package: crayon (1.5.2)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘crayon’ ...
  • DONE (crayon)
    [2023-02-27T11:50:14.414257907+0000] Installing R package: digest (0.6.31)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘digest’ ...
  • DONE (digest)
    [2023-02-27T11:50:14.801262223+0000] Installing R package: fastmap (1.1.1)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘fastmap’ ...
  • DONE (fastmap)
    [2023-02-27T11:50:15.203205578+0000] Installing R package: fs (1.6.1)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘fs’ ...
  • DONE (fs)
    [2023-02-27T11:50:15.616396490+0000] Installing R package: glue (1.6.2)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘glue’ ...
  • DONE (glue)
    [2023-02-27T11:50:15.980007583+0000] Installing R package: jsonlite (1.8.4)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘jsonlite’ ...
  • DONE (jsonlite)
    [2023-02-27T11:50:16.417591900+0000] Installing R package: magrittr (2.0.3)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘magrittr’ ...
  • DONE (magrittr)
    [2023-02-27T11:50:16.784698731+0000] Installing R package: mime (0.12)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘mime’ ...
  • DONE (mime)
    [2023-02-27T11:50:17.125248182+0000] Installing R package: rappdirs (0.3.3)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘rappdirs’ ...
  • DONE (rappdirs)
    [2023-02-27T11:50:17.468705515+0000] Installing R package: remotes (2.4.2)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘remotes’ ...
  • DONE (remotes)
    [2023-02-27T11:50:17.841213458+0000] Installing R package: rlang (1.0.6)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘rlang’ ...
  • DONE (rlang)
    [2023-02-27T11:50:18.297339261+0000] Installing R package: sourcetools (0.1.7-1)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘sourcetools’ ...
  • DONE (sourcetools)
    [2023-02-27T11:50:18.686860851+0000] Installing R package: withr (2.5.0)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘withr’ ...
  • DONE (withr)
    [2023-02-27T11:50:19.042495842+0000] Installing R package: xtable (1.8-4)
  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing binary package ‘xtable’ ...
  • DONE (xtable)
    [2023-02-27T11:50:19.418306807+0000] Building R package: opencv (0.2.3)
    /mnt/packages/build /mnt
    This is pkg-config 0.29.1
    Using PKG_CFLAGS=
    Using PKG_LIBS=-lopencv_{stitching,superres,videostab,aruco,bgsegm,bioinspired,ccalib,dnn_objdetect,dpm,face,photo,fuzzy,hfs,img_hash,line_descriptor,optflow,reg,rgbd,saliency,stereo,structured_light,phase_unwrapping,surface_matching,tracking,datasets,dnn,plot,xfeatures2d,shape,video,ml,ximgproc,calib3d,features2d,highgui,videoio,flann,xobjdetect,imgcodecs,objdetect,xphoto,imgproc,core}
    Found C++17 compiler: g++
    -----------------------------[ ANTICONF ]-------------------------------
    Configuration failed to find opencv4 library. Try installing:
  • deb: libopencv-dev (Debian, Ubuntu, etc)
  • rpm: opencv-devel (Fedora, CentOS, RHEL)
  • brew: opencv (Mac OSX)
    If opencv4 is already installed, check that 'pkg-config' is in your
    PATH and PKG_CONFIG_PATH contains a opencv4.pc file.
    ---------------------------[ ERROR MESSAGE ]----------------------------
    :1:10: fatal error: opencv2/opencv.hpp: No such file or directory
    compilation terminated.

  • installing to library ‘/opt/R/4.2.1/lib/R/library’
  • installing source package ‘opencv’ ...
    ** package ‘opencv’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ERROR: configuration failed for package ‘opencv’
  • removing ‘/opt/R/4.2.1/lib/R/library/opencv’
    ################################# End Task Log #################################
    Error: Unhandled Exception: Child Task 1276992195 failed: Error building image: Error building opencv (0.2.3). Build exited with non-zero status: 1
    Execution halted

The opencv package has a system dependency that is not currently available on shinyapps.io's container image.

You can request a system library to be installed by filing an issue on this github repo but it might take a while.

Thanks for the help.