reactive images do not show up on the published app

Hi guys,

I have some images in www folder that they have to show up by clicking on a part of a map. They work perfectly on my local machine, but they do not show up when the app is published on shinyapps.io. I have tried changing directory address, but did not help! Any idea what the problem could be and how to fix it?

Here is the part of the code on the server file:

output$floorPlan <- renderImage({
                validate(need(sum(BldngsSum$name == bldngClcd()) > 0, ""))
                planType <- BldngsSumCalc()$Btype[BldngsSumCalc()$name == bldngClcd()]
                if (planType == "F1") {
                        return(list(src = "www/F1bldng.png", filetype = "image/png", alt = "F1"))
                } else if (planType == "F2") {
                        return(list(src = "www/F2bldng.png", filetype = "image/png", alt = "F2"))
                } else if (planType == "F3") {
                        return(list(src = "www/F3bldng.png", filetype = "image/png", alt = "F3"))
                } else if (planType == "F4") {
                        return(list(src = "www/F4bldng.png", filetype = "image/png", alt = "F4"))
                }
        }, deleteFile = FALSE)

Here is the link to my app: Seaside, Oregon, USA
It takes a while to be completely loaded. After the map shows up, you should click on any of the orange buildings. An image is supposed to show up on the right side after the tables on "Building Info." section. But, a broken image icon shows up!

I just fixed it myself! So, here is the solution for those might have the same issue:

Instead of publishing the app from console or RStudio icon, I took the following steps:

  1. I ran the app locally using runApp()
  2. I clicked on one of the buildings to make the corresponding image show up
  3. I used the "publish application" icon on the app window to publish the app
  4. That's all! It worked!!!

I think the trick was that click on one of the buildings. Maybe that click was required to activate that feature while getting published on shinyapps.io!

Hope this helps people with a similar issue in the future and save their time and energy... I have spent a lot to fix it and it was very frustrating and exhausting.