【发布时间】: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