I use the publish section in the build.gradle file to publish the Android library to Artifactory:
publishing {
publications {
aar(MavenPublication) {
groupId packageName
version = libraryVersion
artifactId project.getName()
// Tell maven to prepare the generated "*.aar" file for publishing
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
pom.withXml {
def dependencies = asNode().appendNode('dependencies')
configurations.getByName("_releaseCompile").getResolvedConfiguration().getFirstLevelModuleDependencies().each {
def dependency = dependencies.appendNode('dependency')
dependency.appendNode('groupId', it.moduleGroup)
dependency.appendNode('artifactId', it.moduleName)
dependency.appendNode('version', it.moduleVersion)
}
}
}
}
}
The following error failed:
Execution failed for task ':smartcardsdk:generatePomFileForAarPublication'.
> Could not apply withXml() to generated POM
> Configuration with name '_releaseCompile' not found.
This is not a problem with Android v2.x. The problem started when I upgraded to Android Studio v3 (and, I think, Gradle v3.0.0).
I assume that the configurations are no longer saved with the name _releaseCompile.
Does anyone know what a new "name" should be?
Thank.
source
share