question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid MavenPublish Configuration. Unable to find variant to publish named release. Try setting the 'androidVariantToPublish' property in the mavenPublish extension object to something that matches the variant that ought to be published.

See original GitHub issue

Gradle 7.0 Plugin 0.15.1 AGP 4.1.3

  • What went wrong: Invalid MavenPublish Configuration. Unable to find variant to publish named release. Try setting the ‘androidVariantToPublish’ property in the mavenPublish extension object to something that matches the variant that ought to be published.

This error is gotten when using the base plugin:

mavenPublishing {
    configure(com.vanniktech.maven.publish.AndroidLibrary(com.vanniktech.maven.publish.JavadocJar.Javadoc()))
}

the default variant is already release so I’d say it’d not be necessary nothing else other than the basic configuration in the base plugin right, pom, signAllPublications and configure

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
ntoskrnlcommented, May 21, 2021

@marandaneto I had the same issue, using aferevaluate fixes this issue.

0reactions
gigagacommented, Jun 15, 2021

Hi @gabrielittner

Same issue for me 😦 Can u tell me when the next release will be publish?

Regards,

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is MavenPublishPlugin running too early? #131 - GitHub
The error is caused by this line. It looks like it is trying to configure the publish plugin before the variants / components...
Read more >
How to publish all flavor variants to maven with Android ...
I am facing a similar problem. Although I don't use productFlavors , I am expecting mavenDeployer to publish three configurations ...
Read more >
MavenPublication - Gradle DSL Version 7.6
A MavenPublication is the representation/configuration of how Gradle should publish something in Maven format. You directly add a named Maven Publication ...
Read more >
Support maven-publish plugin [37055147] - Visible to Public
Publishing only a release variant causes gradle sync to fail on the consumer without even showing why (they have to execute a gradle...
Read more >
Configure publication variants | Android Developers
If you use a POM file, you can publish additional artifacts using classifiers, but the additional artifacts can't have their own dependencies.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found