我一直在尝试本部署教程,以使用bitrise(https://www.bitrise.io/integrations/steps/google-play-deploy)在Google上玩,但没有成功。
有时我遇到错误Failed to perform edit insert call, error: Post https://www.googleapis.com/androidpublisher/v3/applications/org.aacctt.[REDACTED]/edits?alt=json&prettyPrint=false: metadata: GCE metadata "instance/service-accounts/default/token?scopes=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fandroidpublisher" not defined
已经尝试找到 token 作用域的问题,但没有发现任何有用的东西。知道有什么问题吗?
日志片段:
+------------------------------------------------------------------------------+
| (9) google-play-deploy@3 |
+------------------------------------------------------------------------------+
| id: google-play-deploy |
| version: 3.0.2 |
| collection: https://github.com/bitrise-io/bitrise-steplib.git |
| toolkit: go |
| time: 2020-05-04T17:39:34Z |
+------------------------------------------------------------------------------+
| |
Getting configuration
Configs:
- JSONKeyPath: *****
- PackageName: org.aacctt.[REDACTED]
- AppPath: /bitrise/deploy/app-release-bitrise-signed.apk\n
- ExpansionfilePath:
- Track: internal
- UserFraction: 0
- WhatsnewsDir:
- MappingFile:
Found .apk file: /bitrise/deploy/app-release-bitrise-signed.apk
Configuration read successfully
Authenticating
Authenticated client created
Create new edit
Failed to perform edit insert call, error: Post https://www.googleapis.com/androidpublisher/v3/applications/org.aacctt.[REDACTED]/edits?alt=json&prettyPrint=false: metadata: GCE metadata "instance/service-accounts/default/token?scopes=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fandroidpublisher" not defined
| |
+---+---------------------------------------------------------------+----------+
| x | google-play-deploy@3 (exit code: 1) | 12.45 sec|
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-google-play-deploy/issues |
| Source: https://github.com/bitrise-io/steps-google-play-deploy |
+---+---------------------------------------------------------------+----------+
最佳答案
我也遇到了此错误,事实证明,就我而言,我没有设置Play商店服务帐户密钥文件路径的正确路径。需要服务帐户才能在Play商店控制台中对Bitrise进行身份验证。
解决方案是将BITRISE_DEPLOYER_SERVICE_ACCT_KEY
env var的值设置为包含您的json文件的有效URL。一种方法是将帐户密钥直接上传到Bitrise(在“代码签名”标签下的“通用文件存储”区域上),然后在工作流程的“部署到Google Play”步骤中引用生成的URL。
我想您也可以将json文件存储在GCS之类的安全环境中,并将env var设置为文件URL