google-api-python-client icon indicating copy to clipboard operation
google-api-python-client copied to clipboard

[Support] The following APK version codes could not be found: 1 on androidpublisher/v3/edits/validate api call

Open efremovd opened this issue 3 years ago • 3 comments

Hi

Not sure what happens as this code worked well without any changes for few years but today I can't publish apk through api using google-api-python-client

Will release package com.betria.flightpath3d (FlightPath3D-bundled-signed-07.17.00.54568-rc16.apk), version 07.17.00.54568-rc16 to 'internal' track
file_cache is only supported with oauth2client<4.0.0
URL being requested: POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.betria.flightpath3d/edits?alt=json
Making request: POST https://oauth2.googleapis.com/token
Uploading apk...
URL being requested: POST https://androidpublisher.googleapis.com/upload/androidpublisher/v3/applications/com.betria.flightpath3d/edits/07800827871474792430/apks?alt=json&uploadType=media
Uploaded, versionCode 54568
Updating release information...
URL being requested: PUT https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.betria.flightpath3d/edits/07800827871474792430/tracks/internal?alt=json
Updated - {'track': 'internal', 'releases': [{'name': '07.17.00.54568-rc16 - 54568', 'versionCodes': ['54568'], 'status': 'completed'}]}
URL being requested: POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.betria.flightpath3d/edits/07800827871474792430:validate?alt=json
Traceback (most recent call last):
  File "/apk_upload.py", line 117, in <module>
    main()
  File "/apk_upload.py", line 110, in main
    print(service.edits().validate(editId=trans.transactionId, packageName=package_name).execute())
  File "/usr/local/lib/python3.10/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/googleapiclient/http.py", line 938, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 404 when requesting https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.betria.flightpath3d/edits/07800827871474792430:validate?alt=json returned "The following APK version codes could not be found: 1". Details: "The following APK version codes could not be found: 1">

Even calling just edits.insert and edits.commit will throw the same error. Anyone else seeing similar issue? Thanks.

Lib versions:

google-api-core          2.10.2
google-api-python-client 2.64.0
google-auth              2.12.0
google-auth-httplib2     0.1.0
googleapis-common-protos 1.56.4

efremovd avatar Oct 14 '22 01:10 efremovd

Thanks for filing this issue. Are you still experiencing this problem? Are you able to publish your APK without this client library, but having problems publishing via this library?

vchudnov-g avatar Mar 15 '23 20:03 vchudnov-g

Hi, yes it's still there. Yes we can upload and publish apk through web site. It just was much easier with automation.

efremovd avatar Mar 17 '23 16:03 efremovd

Well we workarounded it by creating and manually uploading apk with versionCode 1. After that api started to work...

efremovd avatar Mar 22 '23 18:03 efremovd