Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error uploading bundles #20

Closed
Almighty-Alpaca opened this issue Mar 31, 2023 · 2 comments · Fixed by #21
Closed

Error uploading bundles #20

Almighty-Alpaca opened this issue Mar 31, 2023 · 2 comments · Fixed by #21

Comments

@Almighty-Alpaca
Copy link
Contributor

Hi, I'm trying to use the CLI to upload an AppBundle to the Play Store. I'm using the Docker image with $PWD mounted to /config and get the following error:

$ export PLAYSTORE_SERVICE_ACCOUNT_JSON_FILE=<redacted>
$ export APP_PACKAGE_NAME=<redacted>
$ google-play-cli apk list
{"kind":"androidpublisher#apksListResponse"}
$ edit_id=$(google-play-cli edit create)
$ google-play-cli bundles upload --edit-id $edit_id --bundle app.aab
Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
PUT https://www.googleapis.com/upload/androidpublisher/v3/applications/<redacted>/edits/<redacted>/bundles?ackBundleInstallationWarning=false&uploadType=resumable&upload_id=<redacted>
{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Media type 'application/vnd.android.package-archive' is not supported. ",
    "reason" : "badRequest"
  } ],
  "message" : "Media type 'application/vnd.android.package-archive' is not supported. ",
  "status" : "INVALID_ARGUMENT"
}
        at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:150)
        at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
        at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:432)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
        at com.github.vacxe.googleplaycli.actions.Bundles$DefaultImpls.bundlesUpload(Bundles.kt:25)
        at com.github.vacxe.googleplaycli.PlayStoreApi.bundlesUpload(PlayStoreApi.kt:14)
        at com.github.vacxe.googleplaycli.Commands$Bundles$Upload.run(Commands.kt:33)
        at com.github.vacxe.googleplaycli.Commands$Bundles$Upload.run(Commands.kt:28)
        at com.github.vacxe.googleplaycli.core.BaseCommand.run(BaseCommand.kt:52)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:154)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:162)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:162)
        at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:14)
        at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:252)
        at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:249)
        at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:267)
        at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:290)
        at com.github.vacxe.googleplaycli.PlayStoreCliKt.main(PlayStoreCli.kt:89)

Is there any workaround for this?

@Almighty-Alpaca
Copy link
Contributor Author

Almighty-Alpaca commented Apr 1, 2023

I've just had a bit of time to investigate and found the problem. application/vnd.android.package-archive is for APK files specifically, which for obvious reasons doesn't work for app bundles. it seems like this is a leftover from copy/pasting the code for APKs. I have confirmed that using the generic application/octet-stream works without any issues,

I've fixes this in #21

@Almighty-Alpaca
Copy link
Contributor Author

Almighty-Alpaca commented Apr 1, 2023

If anyone else is having the same issue as me I've uploaded a Docker image with this fix as almightyalpaca/google-play-cli:fix-bundle-upload. Feel free to use it until #21 has been merged.

@Vacxe Vacxe closed this as completed in #21 Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant