问题 AndroidPublisher API返回projectNotLinked错误


当我在Google Developers Console中使用Google Play Android Developer API测试购买产品的状态时,会发生这种情况,结果总是如此

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

使用其他开发者帐户(和包名称)检查了这一点,它工作得很好。我确定已将Google开发者控制台的API项目与Google Play开发者控制台 - > API访问设置相关联,并尝试尽可能多地重新创建,但没有任何项目有效。

那我在这里错过了什么?除了我在Google Play控制台设置中制作的链接项目外,它的含义是什么“无法链接”。


8407
2017-08-06 09:17


起源



答案:


几天后,我尝试使用API​​ Explorer来使用Android Publisher API但失败了,我请求Google支持并收到答案“看起来发布API不再支持API Explorer”。所以基本上我不能再使用API​​ Explorer来检查应用内购买令牌。 希望这有助于谁在努力解决这个问题。


8
2017-08-26 03:21



我猜还有另外一个错误。如果不支持,为什么它在2017年11月的API参考中(您的帖子是3年前)。我猜它是支持的,因为链接出了问题。在我链接项目后,我得到了 Edit not found for this application 并不是 The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console. - Bevor


答案:


几天后,我尝试使用API​​ Explorer来使用Android Publisher API但失败了,我请求Google支持并收到答案“看起来发布API不再支持API Explorer”。所以基本上我不能再使用API​​ Explorer来检查应用内购买令牌。 希望这有助于谁在努力解决这个问题。


8
2017-08-26 03:21



我猜还有另外一个错误。如果不支持,为什么它在2017年11月的API参考中(您的帖子是3年前)。我猜它是支持的,因为链接出了问题。在我链接项目后,我得到了 Edit not found for this application 并不是 The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console. - Bevor


我也得到了这个,只是放弃了让它工作,而是切换回API的v1.1:

final URL url = new URL(
        "https://www.googleapis.com/androidpublisher" +
        "/v1.1/applications/" + "com.example.app.id" +
        "/subscriptions/" + subcriptionId +
        "/purchases/" + googlePurchaseReceipt +
        "?access_token=" + googleAccessToken);

希望有人会在某个时候发布更好的答案,我们都可以切换到API的v2。


2
2017-08-10 01:58





您需要在Google中链接项目  设置 - > Api访问下的开发者控制台。

在这里看到我的完整答案: https://stackoverflow.com/a/25825907/1745234


2
2017-09-13 17:48



我已经做到了,但似乎问题不在于链接项目。 - vnoob0


如果其他人遇到相同问题,请尝试在您的Google Play控制台帐户中添加新产品/订阅。这对我有用,虽然似乎是Google服务中的某种不一致问题。


1
2017-09-27 15:48



我花了两个多小时试图解决这个问题,然后才磕磕绊绊地回答这个问题......谢谢! - BarrensZeppelin


使用“SERVICE ACCOUNT”进行身份验证时,我收到了相同的错误消息。但是当使用“已安装的应用程序”类型的OAuth客户端时,一切正常。修理:

  1. 转到Google Play开发者控制台上的API访问页面。
  2. 单击“创建oAuth客户端”按钮。
  3. 确保选择“已安装的应用程序”
  4. 使用生成的客户端ID和密码来获取访问/刷新令牌,如中所述 https://developers.google.com/android-publisher/authorization
  5. 使用访问令牌发出api请求。

0
2017-08-12 04:36



是的,这种方式工作正常,问题是服务帐户与API的V2一起。 - vnoob0


API Explorer似乎不适用于API的v2。已报告错误: https://code.google.com/p/google-apis-explorer/issues/detail?id=268


0
2018-06-03 21:42