0
votes

and thanks for any help!

I keep getting the same error message when trying to publish the app on shinyapps.io:

The application failed to start (exited with code 1).

I have already commented the setwd() and library(shiny) as I have learned from other posts, but so far no luck. This is the screenshot of the error.

enter image description here

enter image description here

I am new to this, so any support is greatly appreciated.

2

2 Answers

1
votes

It looks to me like you are using an absolute file path in your script. shinyapps.io won't understand a file path specific to your machine.

Instead, try putting the files you need to read in a folder (e.g. 'InputFiles') and put that folder in the same place as your scripts. Change your scripts to refer to files using relative file paths like: 'InputFiles/file1.csv'.

When you run the code locally make sure to set the working directory to the same directory your scripts are in. When you publish to shinyapps.io make sure to include your scripts and the 'InputFiles' directory.

Here's a great explanation of how these work: https://docs.rstudio.com/shinyapps.io/Storage.html#Storage

0
votes

The solution came to me after reading Thomas's post. I had an R script (which did all the statistics and plots for my dashboard) stored in the same folder where the shiny UI and server were stored. After moving this script file to a different folder, the problem was solved. I do not quite understand why this fixed the issue, but I hope this article helps people facing similar issues.