Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.1k stars 340 forks source link

[3.5.0] This Edit has been deleted #998

Closed NoNews closed 2 years ago

NoNews commented 3 years ago

Describe the bug

Sometimes (1/20 times) it's still possible to have an error "This Edit has been deleted."

 > A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishBundle$BundleUploader
           > 400 Bad Request
             PUT https://androidpublisher.googleapis.com/upload/androidpublisher/v3/applications/com.app.package.name/edits/16974226534760413493/bundles?uploadType=resumable&upload_id=ADPycdtFGYdgemfW7HIgsBIvHwnT4VKQRuyc-dwgu5C-scCb-NY7wt7ZqyBt7i8DjxItWWCHe_uZI-A-Uqjx8WRbgOSFDw8JZA
             {
               "code": 400,
               "errors": [
                 {
                   "domain": "global",
                   "message": "This Edit has been deleted.",
                   "reason": "badRequest"
                 }
               ],
               "message": "This Edit has been deleted.",
               "status": "INVALID_ARGUMENT"
             }

How To Reproduce

Versions

+--- com.github.triplet.gradle:play-publisher:3.5.0
|    +--- com.github.triplet.gradle:android-publisher:3.5.0
|    |    +--- com.github.triplet.gradle:common-utils:3.5.0
|    +--- com.github.triplet.gradle:common-utils:3.5.0
|    +--- com.github.triplet.gradle:common-validation:3.5.0
Gradle 7.1.1
+--- com.android.tools.build:gradle:4.2.1
|    +--- com.android.tools.build:gradle:3.3.2 -> 4.2.1 (*)
|    +--- com.android.tools.build:gradle:4.2.1 (*)

Tasks executed

publishBundle

Expected behavior

Application published without errors

SUPERCILEX commented 3 years ago

Are you running builds in parallel? The API has a limitation that only one change can be active at once, so if your CI system is running a build and then someone else does something that uses the API, the changes from your original CI build will be deleted.

NoNews commented 3 years ago

Hi @SUPERCILEX, thank you and sorry for long response from my side

Sometimes we can publish different products in parallel for one google account. This error also can be existed if we publish only one product at one particular time.

However, under the hood, publication of one product looks like this:

SUPERCILEX commented 3 years ago

Hmmm, as long as each product has a different package name, you should be fine (changes are keyed by the package name). Are you using ResolutionStrategy.AUTO? If so, simply running a release build will create a change, so you might want to watch out for that. Aside from those two tips, there's not much else I can do.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

NoNews commented 2 years ago

We didn't modify default strategy. By default It's ResolutionStrategy.AUTO, correct?

If so, simply running a release build will create a change

Could you please clarify what do you mean by that?

Thank you!

SUPERCILEX commented 2 years ago

No, by default it's FAIL.

Could you please clarify what do you mean by that?

If you use AUTO, on all release builds a task will run to query the API for the highest used version code so that the apk/bundle uses highest + 1. If you really haven't modified the resolution strategy, then you don't have anything to worry about there.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.