【发布时间】:2015-07-03 15:37:14
【问题描述】:
我正在使用 gradle-play-publisher 库将我的应用上传到 Google Play,但在执行发布任务时出现错误 401 Unauthorized。 我在 Google Play 的开发帐户和开发控制台的服务帐户已设置。播放 API 已启用。
我从构建日志中看到,发送的第一个请求是:
POST https://accounts.google.com/o/oauth2/token
我得到 200 OK 和以下 json:
{
"access_token" : "< some value here>",
"token_type" : "Bearer",
"expires_in" : 3600
}
然后发送下一个请求:
POST https://www.googleapis.com/androidpublisher/v2/applications/< my app's package name here>/edits
首先,我注意到了这个标题:
Authorization: <Not Logged>
其次,我收到此错误作为响应
401 Unauthorized
WWW-Authenticate: Bearer realm="https://accounts.google.com/", error=invalid_token
有人遇到过同样的问题吗?一切似乎都设置正确,所以我不知道出了什么问题。谢谢。
【问题讨论】:
标签: android google-play android-gradle-plugin