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.13k stars 341 forks source link

Build fails on the version conflict with ResolutionStrategy.IGNORE #1109

Closed dmitrytavpeko closed 1 year ago

dmitrytavpeko commented 1 year ago

Describe the bug

When you try to upload a new bundle with the same version code and resolutionStrategy.set(ResolutionStrategy.IGNORE) set, the build still fails with the following message: { "code": 403, "errors": [ { "domain": "global", "message": "Version code 1 has already been used.", "reason": "forbidden" } ], "message": "Version code 1 has already been used.", "status": "PERMISSION_DENIED" } Looks like Google Play has changed the error message, and the lib can't recognise the error anymore. See this line: m.contains("version code") || m.contains("Cannot update", ignoreCase = true).

I believe we can fix it with the following change: m.contains("version code", ignoreCase = true) || m.contains("Cannot update", ignoreCase = true)

How To Reproduce

Set resolutionStrategy.set(ResolutionStrategy.IGNORE) and try to upload a bundle with the same version code.

Expected behavior

The task should not fail.

oliverlockwood commented 1 year ago

Thanks @dmitrytavpeko for the fix and @SUPERCILEX for merging.

@SUPERCILEX if there's any possibility of a release being issued soon to include this, that would be great. Many thanks.

oliverlockwood commented 1 year ago

Update: I found it is already released in 3.8.6 (see https://github.com/Triple-T/gradle-play-publisher/commits/master).

(I had originally been looking at https://github.com/Triple-T/gradle-play-publisher/releases which doesn't yet mention the new release.)

SUPERCILEX commented 1 year ago

Added the release notes. I tend to wait a bit in the hopes that someone will catch any introduced bugs before it's announced to everybody.