Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Cypher103360 opened this issue Jan 8, 2024 · 0 comments

Comments

@Cypher103360
Copy link

Cypher103360 commented Jan 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant