You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

配置Google Developer API自动化发布遇403权限拒绝问题求助

问题:Google Play Developer API 403权限拒绝错误

我正在尝试通过Google Developer API配置应用发布自动化,已按用户指南创建了拥有Service Account User和Owner权限的服务账号,该账号已显示在Google Play Console中,且已为其分配了应用的完整管理员权限与全访问权限。

我已生成该服务账号的.json密钥,使用Python的google-api-client库进行测试。目前仅创建了带有包名的测试应用,尚未上传APK。

测试代码

from google.oauth2 import service_account
import googleapiclient.discovery
import httplib2
if __name__ == '__main__':
    scopes = ['https://www.googleapis.com/auth/androidpublisher']
    package_name = 'xxxxxxxxxxxx'
    service_account_file = 'creds.json'
    credentials = service_account.Credentials.from_service_account_file(
        service_account_file, scopes=scopes)
    
    print(type(credentials))
    # delegated_cre.dentials = credentials.with_subject('rohella.anshuman@gmail.com')
    android = googleapiclient.discovery.build('androidpublisher', 'v3', credentials=credentials)
    res = android.edits().insert(body={}, packageName=package_name).execute()
    print(res) 

错误日志

(env) ➜  android-publish python main.py
<class 'google.oauth2.service_account.Credentials'>
Traceback (most recent call last):
  File "/Users/xxxxxx/Workspace/xxxxxxxx/android-publish/main.py", line 14, in <module>
    res = android.edits().insert(body={}, packageName=package_name).execute()
  File "/Users/xxxxxxx/Workspace/xxxxxxxx/android-publish/env/lib/python3.9/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/Users/xxxxxx/Workspace/xxxxx/android-publish/env/lib/python3.9/site-packages/googleapiclient/http.py", line 938, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.odecloud.odesocial.beta/edits?alt=json returned "The caller does not have permission". Details: "The caller does not have permission">

补充权限截图

  • Google Cloud Console中服务账号用户权限:
    服务账号权限
  • 服务账号信息:
    服务账号
  • 服务账号权限详情:
    服务账号权限详情

内容的提问来源于stack exchange,提问作者Anshuman Rohella

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.08 11:35:19