Can't add android library to JCenter

Viewed 896
2 Answers

Your Bintray Maven Package doesn't contain the sources, only .aar and the .pom. The in the blog post isn't linked to JCenter, see blog's package here.

Bintray's wiki states that you have to include the sources.

I would use this blog post or this one, where the packages are actually linked to JCenter.

For developers who reach here today, make sure your configuration file has artifact(sourcesJar.get()) in publishing{} like these lines below (not complete build.gradle.kts).

val sourcesJar by tasks.registering(Jar::class) {
    classifier = "sources"
    from(sourceSets.main.get().allSource)
}

publishing {
  publications {
    create<MavenPublication>("default") {
      from(components["java"])
        artifact(dokkaJar)
    }
  }

  publications.invoke {
    publicationName(MavenPublication::class) {
      artifactId = artifactID
      artifact(sourcesJar.get()) // This line
    }
  }
}
Related