shiny app shows error code 1 but works fine in my local page

When you deploy your app to shinyapps.io, it runs on their servers, not in your local system, so you can't (and shouldn't anyways) set the working directory to a location in your own file system.

There is no need to use setwd() on a shiny app, the app's root directory is the base for all relative paths on run time. Just remove that command from your code.

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue. Have a look at these resources, to see how to create one for a shiny app

1 Like