Google Docs Add-on – Publish new version

736 views
Skip to first unread message

Mark Grimshaw-Aagaard

unread,
May 17, 2021, 5:14:17 AM5/17/21
to Google Apps Script Community
Hi all,

I have an approved Google Docs app. This morning, I added some extra code, deployed a new version (no changes to OAuth etc.), then followed these steps to publish the new version:


Apparently, clicking on 'Save' means the new version is now published

Since I have my add-on already installed on my primary google account I can't find any way to confirm that other users are getting the updated version. On the marketplace, there is this:
Screenshot 2021-05-17 at 10.54.45.png

The previous pubished version was 6 and I've updated to 7. Does anyone know what the '6' in the image stands for? The version or, given the icon to the left, the number of people who have downloaded/installed the add-on?

I have a secondary google account so I log in as that user on another web browser, open a document and find my add-on in the marketplace. I click on install, click on 'Continue' on the authorization screen, then I get a variety of pop-ups opening and closing, then the google wheel of death for about 10 seconds and that's it. The add-on page gives no indication it is installed (I still have the giant 'Install' button) and there is no add-on in my new document.

Any ideas where I might have gone wrong? Perhaps it takes time for a new version to make it to the marketplace (but then why doesn't the old version install?).

Regards,

Mark

Alan Wells

unread,
May 17, 2021, 11:03:51 AM5/17/21
to Google Apps Script Community
That number 6 is the number of current installations.  It's not the version number.  And it's not necessarily people who are actively using your add-on.  They may have installed it, never used it, and never uninstalled it.  That installation number has a history of not being updated on a regular basis, and has sometimes changed drastically.  But that's a different issue than your version number question.
I don't know of a "built-in" way of displaying the version number to the user.  That would be a nice feature to have, but as far as I know, the project version number isn't shown anywhere.  You can create your own dialog box, or show a version number somewhere in your UI.  But you've got to do that yourself.  Every time that I publish a new version, I hardcode a new number in my code.  And then my error handling gets that number.  Plus I have a dialog box just for the "About" information.  If you saved a new version in the App Configuration, and when you refresh or revisit the page, the number is there, then the new version is active.  But of course, you'd like a way to confirm that.  I have a function just for the version number, then I hard code the version number.


Mark Grimshaw-Aagaard

unread,
May 17, 2021, 11:08:51 AM5/17/21
to Google Apps Script Community
Thanks Alan,

I have an About box with a version number and of course I see that as I am the developer. I'm puzzled why I can't install the add-on with my test google account. That would confirm whether it's all updated or not.

Regards.

Mark

Alan Wells

unread,
May 17, 2021, 11:55:12 AM5/17/21
to Google Apps Script Community
If you did a test from a Google account that you own, but that is different than the account that owns the add-on, and that test account can't install the add-on, then I'd say that there is definitely a problem.  Who knows what the problem is, but obviously it should work.  It can take some time to update the new version to servers around the world.  I have no idea what that entails, or how fast or slow it is, but I'm guessing that within 1/2 an hour the new version should be available.  Just out of curiosity, which code editor did you use to update the code to a new version number?  Legacy or new?

Mark Grimshaw-Aagaard

unread,
May 17, 2021, 12:02:54 PM5/17/21
to Google Apps Script Community
I used the new code editor and the DEPLOY button.

Mark Grimshaw-Aagaard

unread,
May 17, 2021, 12:06:34 PM5/17/21
to Google Apps Script Community
. . . and I got a new version number along with deployment number. However, as per the guidlines above, the only thing I needed to change in the app configuration was the version number. In both editors, the correct version number (7) is shown.

Mark

Alan Wells

unread,
May 17, 2021, 12:21:17 PM5/17/21
to Google Apps Script Community
I don't use the new code editor, especially for managing deployments, so I'm not totally sure what that situation is.
But, with Web Apps people have had issues when they kept creating new Deployments instead of editing existing deployments.
Did you choose "New deployment" or "Manage deployments"

Mark Grimshaw-Aagaard

unread,
May 17, 2021, 12:28:36 PM5/17/21
to Google Apps Script Community
I chose (stupidly?) 'new deployment' thinkng that's what it was.

I can't see anywhere in the legacy editor to edit deployments/versions (which the new editor has but I've never tried so I'm not sure what it does). I can see 'Manage versions' but that only creates a new version. Perhaps I should try another version in the legacy editor?

Mark

Mark Grimshaw-Aagaard

unread,
May 17, 2021, 12:43:24 PM5/17/21
to Google Apps Script Community
Created a new version (9) in the legacy editor and updated the app configuration screen with that number. Clicking on 'Save', I now get:
"Project Key is not associated with the current project or the script version doesn't exist."

I've double-checked that version 9 does indeed exist and that the Project key Perhaps I need to wait a while before trying again.

Confusingly, the error message points to the "Docs Add-On Project Script ID" which, in the legacy editor, is called the 'Script ID' (the 'Project key' is something else).

The only thing I have ever changed today in the app configuration is the version number. Just for fun, I tried inputting the Project key and . . . it saved successfully. Still no luck installing the add-on from my test user. I then changed the Project key field back to what it was (i.e. the Script ID) and . . . it saved successfully again. Still no luck installing the add-on from my test user.

Mark

Alan Wells

unread,
May 17, 2021, 1:31:47 PM5/17/21
to Google Apps Script Community
I think that creating a new deployment when one already exists can lead to problems.
But I'm not sure if that is your current problem.
When I publish a new add-on version, I use the legacy editor, and choose:
File -> Manage Versions
Add a new description and click "Save new version"
Also, in the App Configuration for the "Forms Add-on Project Script ID"
I enter the "Project key" NOT the Script ID.
There was/is a bug I believe when trying to install from the marketplace listing when you go directly to the link in a browser.
If you open up the Marketplace listings from inside the Doc, then I believe it works.
But I don't know whether your current issue is related to that bug.
So, what to try now?  Can you choose "Manage deployments" and get back to the deployment for your version 6?
I'm wondering if there is a way to edit the deployment that was associated with your version 6.
But I'm just guessing, I don't know if it's a good or viable idea.

Mark Grimshaw-Aagaard

unread,
May 18, 2021, 2:46:58 AM5/18/21
to Google Apps Script Community
I've now tried entering the project key (strange: my add-on was approved with the Script ID), and dropped the version back to the original approved one but still no luck.

The only install I'm trying is from within the google docs document.

Mark

Mark Grimshaw-Aagaard

unread,
May 18, 2021, 2:51:20 AM5/18/21
to Google Apps Script Community
I've discovered a solution but not answers as to why I can't install the add-on as a test user.

I asked a colleague with a gmail account to install the add-on and it all worked with the latest version.

I went to another computer and used my test gmail account, successfully installing the latest version of the add-on.

I guess trying it on the one computer with two users and even on different browsers/user is too much for google to handle (something with cookies perhaps).

As I went backwards and forwards several times between new and legacy editors, I have no advice as to which one to use as per the discussion above.

Regards,

Mark

Kim Nilsson

unread,
May 18, 2021, 6:08:56 AM5/18/21
to Google Apps Script Community
New editor using Manage Deployments, and then clicking the pen and creating a new version, works fine.
Don't click the New deployment, as that will starta new branch that has no real connection with the already deployed branch.

Mark Grimshaw-Aagaard

unread,
May 18, 2021, 6:42:24 AM5/18/21
to Google Apps Script Community
Thanks Kim,

That's probably where I went wrong.

Mark

Alan Wells

unread,
May 18, 2021, 9:08:23 AM5/18/21
to Google Apps Script Community
I'm wondering if the second browser that you tried is based on the Chromium engine?  For example, Vivaldi.  There are long standing issues related to Apps Script and multiple Google accounts being logged into the same browser.

Mark Grimshaw-Aagaard

unread,
May 18, 2021, 9:46:07 AM5/18/21
to Google Apps Script Community
Chrome was the third browser I tried. My initial attempt was Firefox, then Safari, then Chrome all on the same computer. Then Firefox on another computer (which worked).

Mark

Apollo12

unread,
Apr 6, 2023, 2:17:44 PM4/6/23
to Google Apps Script Community
Hello Alan and Kin.
I'm also publishing my google sheet add-on extension now.
Firstly, I input script ID and deployment version ID according to tutorial. But it didn't work. so after reading above chatting history. I input "product key" and script version. But it doesn't sill work now.
How can I fix it?
Looking forward to hearing from you soon.
Best regards
Apollo

11111.png

Alan Wells

unread,
Apr 6, 2023, 3:31:16 PM4/6/23
to Google Apps Script Community
The Script ID is wrong. I can see that it is to short to be a valid Script ID.
From the code editor, go to settings, and find the script ID under ID's.
The script ID is about 60 characters long.
You can actually also get the script ID out of the URL in the address bar.
https://script.google.com/home/projects/ YOUR SCRIPT ID IS HERE  /edit
The Script ID is actually the File ID of the Apps Script file.

Reply all
Reply to author
Forward
0 new messages