Deploying R Shiny did not succeed

I tried to publish an R Shiny app but I got this error

I don't know what to do ps: I have updated all the libraries that I use inside the code but still nothing I get the same error would you please help me!

I am using the following code:

library(shiny)
library(dplyr)
library(rgdal)
library(leaflet)
library(shinyWidgets)
library(shinydashboard)   

basin <- readOGR("data/basin.kml", "basin")
map_allocator1 <- read.csv('data/map_allocator1.csv')
map_allocator2 <- read.csv('data/map_allocator2.csv')
map_allocator3 <- read.csv('data/map_allocator3.csv')
tour_polyline <- readOGR("data/tour1.kml", "tour1")
info_360<- read.csv('data/360_photos.csv')

ui <-

  fluidPage(theme = "mystyle.css",
    sidebarLayout(
      sidebarPanel(
        tags$head(
          tags$style(HTML(".main-sidebar {background-color:  #D6E3F0!important;}")))
        ,
        sliderTextInput(
          inputId = "mySliderText",
          label = "Story line",
          grid = TRUE,
          force_edges = TRUE,
          choices = c('1','2','3','4','5','6')
        )
        ,br(),br()
        ,
        (leafletOutput("story_map")),

        htmlOutput("frame2")

      ),
      mainPanel(

        tags$head(tags$style("#current_info{
                                 margin-left:20px;
                                 margin-right:10px;

                                 }"
        )
        )
        ,

        valueBoxOutput("story_line_valubox"),

        htmlOutput("frame")
        ,
        div(id='box1', "Infromation about the current location")
        ,
          htmlOutput("frame1")

          #uiOutput("current_info")

        )
      )
    )

server <- function(input, output) {

  printmap <- reactive({
    if (input$mySliderText %in% info_360$press )
    {
      info_360 %>%
        filter(press == input$mySliderText)
    }
  })

  printingvaluebox  <- reactive({
    if (input$mySliderText %in% info_360$press )
    {
      info_360 %>%
        filter(press == input$mySliderText) %>%
        pull(valuebox)
    }
  })

  output$story_map<- renderLeaflet({
    leaflet() %>%
      addProviderTiles("Stamen.Watercolor",options = providerTileOptions(minZoom=6, maxZoom=6)) %>%
      addPolygons(data = basin,color = "black",weight = 2,opacity = 1,fillOpacity = 0.05 )%>%
      addCircleMarkers(data = map_allocator1,
                       lat = ~lat, lng = ~lon,
                       label = ~no,
                       radius = 8, fillOpacity = 3/4, stroke = FALSE, color = 'steelblue',
                       labelOptions = labelOptions(noHide = TRUE, offset=c(0,0), textOnly = TRUE)
      )%>%
      addCircleMarkers(data = map_allocator2,
                       lat = ~lat, lng = ~lon,
                       label = ~no,
                       radius = 8, fillOpacity = 3/4, stroke = FALSE, color = 'red',
                       labelOptions = labelOptions(noHide = TRUE, offset=c(0,0), textOnly = TRUE)
      )%>%
      addCircleMarkers(data = map_allocator3,
                       lat = ~lat, lng = ~lon,
                       label = ~no,
                       radius = 8, fillOpacity = 3/4, stroke = FALSE, color = 'yellow',
                       labelOptions = labelOptions(noHide = TRUE, offset=c(0,0), textOnly = TRUE)
      )%>%
      addPolylines(data=tour_polyline, color = "red",weight = 1,opacity = 1)%>%
      addMarkers(data=printmap())
  })

  output$story_line_valubox <- renderValueBox({
    valueBox(
      printingvaluebox(),
      width = 7,
      "Current Excursion Station",
      color = "blue"

    )
  })


  output$story_line_map<- renderLeaflet({
    leaflet() %>%
      addProviderTiles("Esri.WorldImagery",options = tileOptions(minZoom = 3 , maxZoom = 16)) %>%
      setView(lng=printmap()$lon, lat=printmap()$lat, zoom=printmap()$zoom_level)
  })

  selectHtml <- reactive({
    if (input$mySliderText ==1)
    {
      return(("trial1.html"))
    }
    else
    {
      return(("triaL2.html"))
    }
  })

  frame_link<- reactive({
      if (input$mySliderText %in% info_360$press )
      {
        info_360 %>%
          filter(press == input$mySliderText) %>%
          pull(mapox)
      }
    })

  output$frame <- renderUI({
    tags$iframe(src=frame_link(), height=700, width=1000)

      })


  output$frame1 <- renderUI({
    tags$iframe(src=selectHtml(), height=700, width=1000)

  })

  output$frame2 <- renderUI({
    tags$iframe(src='carousel.html', height=390, width=575, style="position:relative; top: 20px; left: 0px;")

  })

}

# Run the application
shinyApp(ui = ui, server = server)

I have published 3 apps in R Shiny and all of them were successfully completed, this time I don't know what is the exact problem!

Do you mean you are deploying to shinyapps.io or into your own server? Can you show the logs of your app?

In case it is shinyapps.io you can find them here:

Yes I am using shinyapps.io, in the following photos you can find the logs for my application


The error message mentions an invalid multibyte character in this file, so maybe there is an encoding issue, if possible try to encode the file as utf-8

how to encode the file as utf-8?

I excluded all files with the .kml extension but still, the app refused to be deployed!

Just to clarify, the app is deployed, but it is not starting. When you remove the kml files do you get any different error message in the logs?

I don't know from where you are getting those kml files but maybe you have the option to save them with a specific encoding.

this is the logos after I removed kml files

I think you haven't redeployed successfully because the file is still getting read, so nothing has changed.

this is the status of the app :

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.