bitrise-steplib / steps-google-play-deploy

MIT License
54 stars 38 forks source link

Upload to PlayStore fails with 403, replacingBundleWithApk #57

Closed OleMussmann closed 5 years ago

OleMussmann commented 5 years ago

Version google-play-deploy@1.6.1. Upload to the PlayStore fails with:

Upload apks or app bundle
Failed to upload apk, error: googleapi: Error 403: You cannot insert a bundle with the same version code as an APK in the edit., replacingBundleWithApk

What is 'the edit' mentioned in the error message? Also - as far as I know - we don't build any app bundles.

bitce commented 5 years ago

Hi @OleMussmann!

The error message printed out is the exact response from Google's API after your submission. Can you send us the related build URL?

OleMussmann commented 5 years ago

Hi @bitce!

Thanks for investigating with me. This is the URL: https://app.bitrise.io/build/4dca624c1f044989

bitce commented 5 years ago

Of course! Do you certainly not have a bundle uploaded with the same version code as this APK? I think that's what the error means to say

OleMussmann commented 5 years ago

I do have a bundle uploaded, with version code 1. However, the APK version number is bumped every run with the Set Android Manifest Version Code and Name step.

bitce commented 5 years ago

I see that step being in place, but is your Flutter app certainly using that for these details? For every one of your builds our Deploy to Bitrise step prints out the same data about the app (version_code:1 version_name:1.0.0)

OleMussmann commented 5 years ago

Yes, that was the missing piece! For flutter tweaking the AndroidManifest.xml is not sufficient (or even necessary?). If anybody else stumbles upon this, change the version-numbers and -codes in the following files will do the trick:

android/app/src/main/AndroidManifest.xml
pubspec.yaml
android/app/build.gradle

Thanks a lot @bitce for your detective work!

bitce commented 5 years ago

Awesome news! Of course, happy to have helped :) I'd assume it isn't necessary, but this wasn't clear to me either, just noticed the lack of change.

Happy building! 🎉

alexander-potemkin commented 4 years ago

Indeed - it is a different build.graddle in different cases (was android/app/build.gradle in mine)