Error: 'The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.'

65,443

Solution 1

I understand you. Google confuses you with changing service names and workflows. Their documents aren't updated enough to match their newest API workflows.

I was using the Google Play Developer Service API v2 on the server-side with an alpha-version APK, and had the same error as you: "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."

This is my solution:

Google Developer Console

  1. "Google Developer Console" > "APIs & Auth" subcategory "APIs" > (api list) "Google Play Android Developer API". Set "STATUS" to "ON".

  2. "APIs & auth" subcategory "Credentials" > "Create new Client ID". Choose "Service account" and create the id.

  3. You should get a P12 key from the browser.

Google Play Developer Console

  1. "Google Play Developer Console" > "Settings" > subcategory "API access".

  2. Make a link to your "Linked Project".

  3. "Service Account" place may be already showing your "Service account" CLIENT ID which made "google developer console".

By default this account is gray indicating that it is not active. So you must activate it and set authority manually.

You should now get a correct response from the API.

If you get the same error again, maybe is because you have configured and purchased products in your console before linking the project.

To solve it, simply add new product in your app.

Good luck.

Solution 2

Got the same error trying to validate in-app purchases.

This has worked for me:

Go to

Google Play Developer Console > Settings > API Access.

Find your project under "Linked Project" and click "Link" button.

If you get the same error again, maybe is because you have configured and purchased products in your console before linking the project.

To solve it, simply add new product in your app.

Solution 3

If you receive this response when making a request to Android Publisher API, but your project is already linked try to create new In-App Product. If there is a product created before linking, it fails on product transaction fetching when making a purchase. With new product, error goes away.

https://dev.to/sandris/androidpublisher--projectnotlinked-error-43c7

Solution 4

Your problem may have caused because you created in-app purchase products before creating the service account.

In your developer console, set your in-app purchases product as "INACTIVE". Then save the page. Finally make then "ACTIVE" again. This will refresh things in Google's end, and make everything work.

Solution 5

A couple of days ago I've faced the same problem described here with an android publisher v3 and I did all by instruction but unfortunately unsuccessfully.

It may happen when you did link your google cloud console after than your subscriptions/products created and here I'm gonna describe the tricky solution on how to solve this problem without even contacting google.

I've thought that it might be the problem of synchronization and did a couple of steps.

Solution:

  1. Link your Google Cloud Console account to your Google Play Console if it isn't done yet.
  2. Then go to your subscriptions/products and try to change something there, for example, the price on a 0.01$ and roll it back.
  3. Then do it with all the rest subscriptions/products

Finally, check your integration again. I hope everything should get working now :)

Also, I hope #google will fix these issues soon.

Share:
65,443

Related videos on Youtube

Koushik Goswami
Author by

Koushik Goswami

Updated on March 25, 2022

Comments

  • Koushik Goswami
    Koushik Goswami about 2 years

    I am getting the following error while accessing Google Play Developer API using a service account:

    The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.

    The service account email and .p12 file were generated using the service account option in APIs&Auth -> Credentials. The Application in the Google Play Developer API was linked to the project using the project id as mentioned in google's docs.

    However, I am still getting this error when I try to use the Publishing API. I am looking for a solution to this error and a step by step process to use the Google Publishing API for the Java client to publish an APK using the Google Play Developer API. I am using androidpublisher_v2_public.

  • Fabrizio Farenga
    Fabrizio Farenga over 9 years
    Yes this worked, thank you! I posted a php sample here: stackoverflow.com/a/25825907/1745234
  • woheras
    woheras almost 7 years
    Remember that, you can not create more than one "Linked Project" in Google Play Developer Console. So, you can use the same .p12 file in all of your projects.
  • Manukumar
    Manukumar about 6 years
    Can I call play developer API from Android APP?
  • Jeff Padgett
    Jeff Padgett over 5 years
    I am having a strange situation... SOMETIMES I get this error, and SOMETIMES my purchase is verified. It seems inconsistent and I cannot detect a pattern. Any thoughts?
  • Jeff Padgett
    Jeff Padgett over 5 years
    Could it be because I am testing on internal track? Google docs say:
  • Jeff Padgett
    Jeff Padgett over 5 years
    Google Play accumulates completed test purchases for each user but does not pass them on to financial processing. Test purchases are not automatically canceled, so you might want to manually cancel a test purchase to continue testing. To do so, open the app page in the Play Store. If the test purchase that you want to cancel is a subscription, you can also use the cancel() method of the Purchases.subscriptions API. See here: developer.android.com/google/play/billing/…
  • Nj Subedi
    Nj Subedi over 5 years
    In step 2 of Google Play Console, what should we select in [Select a Role] dropdown menu?
  • User2364902
    User2364902 over 5 years
    Below are the steps should be followed on Gcloud, 1.create a project on Gcloud, 2.on the right side panel tap on API & Services -> Create a Service Account, 3. on the right side panel tap on Pub/Sub -> i).Create Topics, ii).Create a Subsction, iii). now set the permission to [email protected]‌​om as described here developer.android.com/google/play/billing/…, it works
  • David Schumann
    David Schumann over 5 years
    Creating all products new finally solved the issue for me, thanks!
  • mayo
    mayo over 5 years
    Same here, but I just created a new temporal product, then I just deleted it :)
  • Ozgur Akcali
    Ozgur Akcali about 5 years
    Is this a viable solution if there are users who purchased the products?
  • JeremyTM
    JeremyTM about 5 years
    I was able to fix by setting each product as "INACTIVE", then save, then make "ACTIVE" again.
  • alex.dorokhov
    alex.dorokhov almost 5 years
    Works also by setting just a single product to inactive and then back to active state
  • Paulin Trognon
    Paulin Trognon almost 5 years
    Also make sure that you create the product AFTER you linked (cf AFT's answer)
  • Sadik Ali
    Sadik Ali almost 5 years
    That's great! It's worked for me. Thank you so much
  • Magnus
    Magnus over 4 years
    +1000, would never have figured that out from that error message!
  • Konrad Gałęzowski
    Konrad Gałęzowski over 4 years
    Same kind of "sync" happens when you inactivate and activate back your products from Google Play Console. Strange.
  • Sanju
    Sanju about 4 years
    This saved me alot of time and pain!
  • Jarzka
    Jarzka almost 4 years
    This guide was a bit old. Here a more up-to-date version: Google Cloud Platform: console.cloud.google.com/home/dashboard Hambuger menu → Apis & Services → Credentials Manage Service accounts Create Service Account Name it and press Create Role: Token Creator Continue Create Key P12 / JSON Done
  • TheBestBigAl
    TheBestBigAl almost 4 years
    I had the same issue when trying to validate GP subscriptions (which cannot be made INACTIVE once they have been set to ACTIVE). I fixed the "project ID is not linked" problem by changing the name of the subscription listing and saving, and then quickly changing it back again. After that the API call worked immediately.
  • Amir Khalil
    Amir Khalil over 3 years
    This issue was driving me crazy and wasted so much of my time trying to figure this out. Thanks a lot. This is very strange. Google should do something about it.
  • Benjamin Carlsson
    Benjamin Carlsson over 3 years
    If you're signed into multiple Google accounts, it will be hard to access this page using the correct one due to all the redirects. You're best off using incognito mode to sign into the correct Google account.
  • React Dev
    React Dev over 3 years
    To add a new product: Play Developer Console > All Apps > Select your app > Store presence > In-app products > Managed products
  • dgarg
    dgarg over 3 years
    so we can not access the older purchases through this API if the project was not linked as yet?
  • Jay Rathod RJ
    Jay Rathod RJ over 3 years
    Can we change subscription price and roll it back again immediately ? i can not able to access Google Play Developer API Subscription get Access call ? I already have subscription created before and then link up project to google play console in API access could this be the cause ? should i change subscription price and roll it back ? will that work ?
  • suquant
    suquant over 3 years
    @JayRathodRJ Yes, it should help, actually, that is what I am talking about here.
  • Andrew
    Andrew over 3 years
    I spent HOURS on this and THIS solved my problem