错误: 用于调用 Google Play Developer API 的项目 ID 没有链接到 Google Play Developer Console 中。'

我在使用服务帐户访问 Google Play Developer API 时出现以下错误:

用于调用 GooglePlayDeveloperAPI 的项目 ID 没有链接到 GooglePlayDeveloperConsole 中。

服务帐户电子邮件和 .p12文件是使用 APIs&Auth -> Credentials中的服务帐户选项生成的。Google Play Developer API 中的应用程序使用 Google 文档中提到的项目 ID 链接到该项目。

但是,当我尝试使用 PublishingAPI 时,仍然会得到这个错误。我正在寻找这个错误的解决方案和一个逐步的过程,使用 Google 发布 API 的 Java 客户端发布一个 APK 使用 Google Play 开发者 API。我正在使用 androidpublisher_v2_public

73379 次浏览

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.

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.

Check your fastlane/Appfile.

Your package_name match with your project package and the project created in your google account.

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

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.

Should anybody have an issue on trying to find where to link the project (as the interface keeps changing) here's is a current link to their API docs

Google Play Developer API

And if you want a direct link (should their docs change as per usual) then you can find the link page at:

play.google.com/apps/publish/?account=<your_account_id>#ApiAccessPlace

Just for reference, I'm trying to reconcile subscriptions on the server side and after all the oAuth 2.0 has been setup, I'm getting a 403 error :

  "error": {
"code": 403,
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.",
"errors": [
{
"message": "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console.",
"domain": "androidpublisher",
"reason": "projectNotLinked"
}
]
}
}

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.

In case of codemagic

So in my case the problem was because of the Service account key, the json key was created before the access/permission was granted to that service account, so after deleting the old key and creating a new one works for me.