Skip to content

Invalid publication 'release': multiple artifacts with the identical extension and classifier ('aar', 'null').Β #7

Open
@Cypher103360

Description

@Cypher103360

I have been following this Medium doc: Publishing Android libraries to GitHub Packages

This is build.gradle file:

import java.util.Properties

plugins {
    id("com.android.library")
    id("org.jetbrains.kotlin.android")
    id("maven-publish")
}
val getVersionName = "1.0.0"
val getArtifactId = "dynamic-map"
val githubProperties = Properties()
githubProperties.load(
    rootProject.file("github.properties").inputStream()
) // Load GitHub credentials from github.properties file

android {
    ...
}

dependencies {
   ...
}

afterEvaluate {
    val gitUsername = githubProperties.getProperty("gpr.usr")
    val gitPassword = githubProperties.getProperty("gpr.key")

    println("GitHub Username: $gitUsername")
    println("GitHub Token: $gitPassword")

    publishing {
        publications {
            create<MavenPublication>("release") {
                from(components["release"])
                groupId = "com.gaurav.kumar"
                artifactId = getArtifactId
                version = getVersionName
                artifact("$buildDir/outputs/aar/${getArtifactId}-release.aar")
            }
        }
        repositories {
            maven {
                name = "DynamicMapRepo"
                url = uri("https://maven.pkg.github.com/Cypher103360/DynamicMap")

                credentials {
                    username = gitUsername
                    password = gitPassword
                }
            }
        }
    }
}

When I try to publish the library I get this:

gaurav@gaurav-ThinkPad-E15-Gen-4:~/AndroidStudioProjects/DynamicMap$ ./gradlew publish

> Configure project :dynamic-map
GitHub Username: Cypher103360
GitHub Token: *****

> Task :dynamic-map:publishReleasePublicationToDynamicMapRepoRepository FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':dynamic-map:publishReleasePublicationToDynamicMapRepoRepository'.
> Failed to publish publication 'release' to repository 'DynamicMapRepo'
   > Invalid publication 'release': multiple artifacts with the identical extension and classifier ('aar', 'null').

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 1s
25 actionable tasks: 21 executed, 4 up-to-date

@prasad79 @up9cloud @fossabot
Please help me to address this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions