1 year ago

#260422

test-img

Konsumierer

maven-publish produces ZIP file for Android app build

After migrating from Gradle 6 to 7 and the maven plugin to maven-publish plugin, I am seeing a ZIP file being published for my Android application build and I do not know how to get rid of it.

That is my publishing configuration:

publishing {
    publications {
        appRelease(MavenPublication) {
                from components.release_apk
                groupId project.group
                artifactId project.archivesBaseName
                version project.version
                artifact(configurations.archives.artifacts.find { it.name == "mobile-release-unsigned" }) {
                    classifier 'release'
                }
        }

        appStaging(MavenPublication) {
                from components.staging_apk
                groupId project.group
                artifactId project.archivesBaseName
                version project.version
                artifact(configurations.archives.artifacts.find { it.name == "mobile-staging" }) {
                    classifier 'staging'
                }
        }
    }
}

The output of this in my local maven repo is:

  • *.module file
  • *.pom file
  • *.zip file (which I do not want)
  • *-release.apk
  • *-staging.apk

The problem is that both release and staging seem to produce that zip and Artifactory refuses a second upload of the same file.

I am using Gradle 7.4 and AGP 4.2.

How to get rid of the ZIP file?

Thanks in advance!

EDIT: As stated here, AGP publishes a ZIP per default: https://issuetracker.google.com/issues/37055147#comment20 Does anybody know how that can be skipped?

android

gradle

android-gradle-plugin

maven-publish

0 Answers

Your Answer

Accepted video resources