2

Here is my code for a simple test app:

library(shiny)
library(shinydashboard)
library(googlesheets4)
library(googledrive)
library(DT)

drive_auth(email = "xxxx")

shinyws1<-gs4_create("WS1")
#table<-read_sheet("xxx")

# Define UI for application
ui <- fluidPage(
   
   # Application title
   titlePanel("Test App"),
   
   # Sidebar with a slider input for number of bins 
   sidebarLayout(
      sidebarPanel(
         numericInput("bins",
                     "Number of friends:",
                     min = 1,
                     max = 100,
                     value = 50),
         actionButton("submit","Submit",class="btn-success")
      ),
      
      # Show a plot of the generated distribution
      mainPanel(
         #blank so far
      )
   )
)


# Define server logic required to draw a histogram
server <- function(input, output) {
   
   #results<-reactive(input$bins)
  observeEvent(input$submit,{
    shinyws1 %>% sheet_append(as.data.frame(input$bins))
  }) 
  
   
}

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

It works okay in my local server. But deployment fails.

Here is the error message generated after deployment in Shinyio server:

Error in value[[3L]](cond) : Can't get Google credentials.
Are you running googledrive in a non-interactive session? Consider:
  * `drive_deauth()` to prevent the attempt to get credentials.
  * Call `drive_auth()` directly with all necessary specifics.
  * Read more in: https://gargle.r-lib.org/articles/non-interactive-auth.html
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

Does anyone know how to fix it? I've tried every workaround I found online, but it didn't work.

zx8754
  • 52,746
  • 12
  • 114
  • 209
Diya
  • 133
  • 6

0 Answers0