Skip to content

DefaultEditManager#findMaxAppVersionCode ignores inactive bundles/apks #1197

Description

@DennisHartrampf

Describe the bug

The com.github.triplet.gradle.androidpublisher.internal.DefaultEditManager#findMaxAppVersionCode ignores inactive bundles/apks. It only considers bundles/apks that are deployed in an active track. In my case I had an inactive bundle with the versionCode 19 - which was by coincidence the latest bundle. I use the com.github.triplet.gradle.androidpublisher.ResolutionStrategy.AUTO. So in my case the plugin determined, versionCode 19 was good to use for a new upload. This prevented uploading/publishing a new bundle via the plugin, because the Play Console returned an error about using an already used versionCode:

Execution failed for task ':androidApp:publishReleaseBundle' (registered by plugin 'com.android.internal.application').
  > A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishBundle$Processor
     > There was a failure while executing work items
        > A failure occurred while executing com.github.triplet.gradle.play.tasks.PublishBundle$BundleUploader
           > Concurrent uploads for app my.app.id (version code already used). Make sure to synchronously upload your APKs such that they don't conflict. If this problem persists, delete your drafts in the Play Console's artifact library.

How To Reproduce

Have an inactive bundle in the Play Console and try to run publishReleaseBundle.

Versions

Tasks executed

What tasks did you run? For example, publishReleaseBundle.

Expected behavior

Don't ignore inactive bundles/apks when determining the next versionCode to use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorwaiting-for-replyIndicates that an issue or pull request needs more information

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions