Connor
Connor

Reputation: 397

Publishing a Google Docs Add-on: Project Key is not associated with the current project

I am attempting to publish a simple Google Docs add-on, following these instructions: Publishing an Add-on

However when completing the configuration for Google Apps Marketplace SDK, I enter my script project key (found from file --> project properties) and receive the following error: 'Project Key is not associated with the current project.'

Only instance where I can find someone with the same problem (here) occurred when they created a project on the Google Developers Console instead of going through resources --> Advanced Google Services. This is not the reason for my error, can anyone shred any light onto my problem?

Any help would be gratefully received, Connor

Upvotes: 18

Views: 4318

Answers (12)

G3N
G3N

Reputation: 321

It is a bit confusing on the GAS UI that it has a copy button for the ID on App Script > Project Settings page, however, it doesnt let me save until I found out the real ID.

As shown below, to get your ID (at least my case), after deployment or manage deployment, you can get the version number and the ID, here is the tricky part that the ID you get here on the URL is different with the one from the copy button.

enter image description here

Upvotes: 0

Rob
Rob

Reputation: 530

My solution: I was using the wrong ID. I had copied the Deployment ID from after the deployment (a Youtube video I watched showed this)

The solution was using the Script ID from the App Script->Project Settings page

Upvotes: 0

yaroslav.mykhailov
yaroslav.mykhailov

Reputation: 41

Looks like it is not possible to change scriptId after a round of review. So you can just update only version. I changed to last number of deployment version like '6' and it is saved.

Upvotes: 0

john_m_kenny
john_m_kenny

Reputation: 343

I was able to fix by combining two successful responses from this post:

  1. use version number, and only the number, e.g. "1" -- Do not use "v1.0" or "Version 1 on Oct 1, 6:10 AM" or your deployment's Description
  1. After completing step 1, delete your entry in field 'Docs Add-On Project Script ID', then re-enter it -- the page seems to not re-evaluate your changes unless you do this; I had tried saving multiple times before doing this with no success using the correct version number and script ID.

Upvotes: 24

Ankit Gupta
Ankit Gupta

Reputation: 175

Try to use the Google Workspace Add On and enter the App Script Deployment ID. That accepted for me and showed it as a Sheets Add-On

Upvotes: 1

Thianesh
Thianesh

Reputation: 61

I got the same error today, I made it finally work. I will go through the fields I checked.

  1. App Integration [I'm deploying using deployment ID, you can get the ID from AppScript manage deployment]

Select the option as per your need

  1. Choose which workspace you are releasing [In my case Sheets], type the version from AppScript.

Sheets addon

  1. Enter all other general Credentials and save.

The above steps worked for me.

Upvotes: 1

EsbenG
EsbenG

Reputation: 28162

Hmm I had issues as well. It didn't work with version 1 in "Docs Add-on script version" but while I tried a bunch of stuff I ended up deploying again and then I incremented version to "2" and then it worked.

Upvotes: 1

陳明傑
陳明傑

Reputation: 1

It's different in deploy or test in legacy editor and new editor.

And I'm using legacy editor before (because some following steps from documents is not work in new editor),

So when I lookup Mange deployment in new editor,

It wasn't exisisted,

And the deployment ID it's not work when I fill out App configuration in Google Workspace Market.

For me I just change to following the Legacy editor's following steps https://developers.google.com/workspace/marketplace/enable-configure-sdk#legacy-editor_2

and It works.

Upvotes: 0

Max
Max

Reputation: 186

For me, the Google App Script file needed to be associated with the project.

  1. In the GAS, go to Resources > Cloud Platform Project.
  2. Under Change Project, enter the project number (which can be found on the home page of the Google Cloud Platform Project in the Project info module), and click Set Project.
  3. Confirm the notices (though make sure that is really what you want to do).
  4. Once it has been set, go back to the App Configuration, and re-enter the information (if you are already on that page, refresh).

That's what worked for me, but maybe other developers get that error for other reasons.

Source: https://developers.google.com/apps-script/guides/cloud-platform-projects#switching_to_a_different_standard_gcp_project

Upvotes: 1

Dr Nic
Dr Nic

Reputation: 2192

I needed to include a correct version number (1,2,3,4; not "v0.1") in addition to the script ID. The error suggested my script ID was wrong, but the error went away when I picked a valid version number.

Upvotes: 3

collin visser
collin visser

Reputation: 41

For me I need to go Publish->Deploy as API. Select the correct version and then the publish screen worked

Upvotes: 4

Connor
Connor

Reputation: 397

Kept trying, did not change the way I tried publishing nor the project key I was entering and it worked after so many retries. Wish I could give a more detailed answer...

Upvotes: 3

Related Questions