After upgrading Gradle to 5.1.1, I found that I'm unable to add bundleReleaseAar
as an artifact to my MavenPublication. Here's the relevant snippet of my build.gradle:
apply plugin: 'maven-publish'
publishing {
publications {
aar(MavenPublication) {
groupId libraryGroupId
version libraryVersion
artifactId libraryArtifactId
artifact bundleReleaseAar
//artifact sourcesJar
//artifact packageJavadoc
}
}
}
This fails with:
Could not get unknown property 'bundleReleaseAar' for object of type org.gradle.api.publish.maven.internal.publication.DefaultMavenPublication.
However, I am able to see that bundleReleaseAar
does indeed exist when I run ./gradlew tasks
, and I can execute that task just fine.
What is preventing it from being used as an artifact in my deployment now?
Gradle automatically generates publishing tasks for all possible combinations of publication and repository, allowing you to publish any artifact to any repository.
I fix this problem change artifact from:
artifact bundleReleaseAar
to:
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
this help me Gradle sync success, but i must call assembleRelease directly, before ./gradlew publish
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With