Search code examples
google-sheetsgoogle-apps-scripttriggersadd-on

Cannot test onInstall on test deployment in google sheet scripts


My onOpen for showing custom menu in google sheet scripts is working perfectly and I have also done onInstall simply like this

function onInstall(e){
   onOpen(e)
}

onOpen is running under all oath types but then google give this error when I try to publish addon

Menu - Menu options not shown after App is installed. Please ensure that the add-on correctly uses onInstall() and onOpen() to populate its menu. The menu items populate when the add-on is first installed and when a different file is opened. See Editor add-on authorization.

So I don't understand this problem also if anyone know how to mock onInstall please let me know.

I tried running test deployment but cannot mock onInstall in it.


Solution

  • Found the solution as Daniel mentioned.

    First private deploy and test the extention then it should work when extention will be deployed publically. Otherwise we can't test onInstall.