我在build.gradle文件中使用发布部分将
Android库发布到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) } } } } }
它失败并出现以下错误:
Execution Failed for task ':smartcardsdk:generatePomFileForAarPublication'. > Could not apply withXml() to generated POM > Configuration with name '_releaseCompile' not found.
这对Android v2.x来说不是问题.我升级到Android Studio v3时出现问题(我猜Gradle v3.0.0也是如此).
我猜测配置不再与_releaseCompile名称一起存储.
有谁知道新的“名字”应该是什么?
谢谢.
解决方法
刚想通了.你必须改为:
"releaseCompileClasspath"