I am trying to use App Submission API to automate the release of new builds.
I am able to successfully create a new edit. When it creates, it contains an apk from my live version uploaded. I would like to remove it before uploading a new one.
This behaviour must be supported as it is covered by the docs
If you want to replace an APK and delete the current targeting information, delete the APK and then upload the new version of the APK.
I am following the full process described in the docs:
- List all apps contained in edit by issuing
GET /{apiVersion}/applications/{appId}/edits/{editId}/apks
(SUCCESSFUL) - For each apk, get its info to receive Etag by calling
GET /{apiVersion}/applications/{appId}/edits/{editId}/apks/{apkId}
(SUCCESSFUL) - Finally,
DELETE /{apiVersion}/applications/{appId}/edits/{editId}/apks/{apkId}
(FAIL)
The last step fails with the following error:
{
"httpCode":400,
"message":"Bad Request",
"errors":[
{
"errorCode":"error_apk_version_already_uploaded",
"errorMessage":"Failed to upload APK. The version codes of all uploaded APKs in an app must be unique. The APK you just uploaded with version code 94 conflicts with the version code of an existing APK in the current version."
}
]}
I am calling my DELETE request with If-Match
header set to etag from step 2. If I try to run it without it, I receive a different error.
Looks like App Submission API has a bug and does not let us delete the apk version from the edit which gets copied from existing version upon creation of an edit. This is unfortunate as I want to delete it specifically to reset targeting.
Also, it is possible to delete it from the console.