【问题标题】:How do you upload an expansion file to a Draft Apk using Google Play Developer API Client Library for Java?如何使用适用于 Java 的 Google Play Developer API 客户端库将扩展文件上传到 Draft Apk?
【发布时间】:2019-11-13 15:52:14
【问题描述】:

我当前的工作流程是将我的 apk(按 abi 拆分 4 个)发布到草稿中的 alpha。这很好用,因为我使用的是 Gradle Play Publisher。

下一步是我上传扩展文件,这是一个自定义的 gradle 任务。

我使用经过身份验证的 AndroidPublisher 开始编辑

val editId=publisher.edits().insert(packageName, null).execute().id

对于我的第一个 apkVariant,我上传了扩展文件

publisher.edits().expansionfiles()
                .upload(
                  packageName,
                  editId,
                  apkVariantOutput.versionCodeOverride,
                  "main",
                  FileContent("application/octet-stream",myFile)
                ).execute()

对于所有后续变体,我引用了新的扩展文件

publisher.edits().expansionfiles().update(
            packageName,
            editId,
            apkVariantOutput.versionCodeOverride,
            "main",
            ExpansionFile().apply {
              referencesVersion = apkVariants[0].versionCodeOverride
            }
          ).execute()

并最终提交此编辑

publisher.edits().commit(packageName, editId).execute()

一些打印的示例输出:

{
  "expiryTimeSeconds" : "1573666146",
  "id" : "04893130212727174754"
}
setting expansion for 6193171
{
  "fileSize" : "590199"
}
{
  "referencesVersion" : 6193171
}
{
  "referencesVersion" : 6193171
}
{
  "referencesVersion" : 6193171
}
{
  "expiryTimeSeconds" : "1573666146",
  "id" : "04893130212727174754"
}

但即使任务完成且没有错误,扩展文件也不会显示在 Play 控制台上。

我希望我从根本上对这个 API 有一些误解,因为我无法理解这一点。

【问题讨论】:

    标签: android kotlin google-play-console gradle-kotlin-dsl google-play-developer-api


    【解决方案1】:

    我使用 Play Developer API 重写了我的整个应用上传流程。

    您无法将扩展文件上传到草稿,this question 仍然有效。我找不到它所指的谷歌问题,但一年后显然仍然如此。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-05
      • 2017-08-09
      相关资源
      最近更新 更多