Reputation: 16238
I've just migrated my Android lib from JCenter to MavenCentral. The process completed successfully and I can find my lib through Sonatype Repo Search.
However, when I try to use the lib in my sample application, I get the following error:
Execution failed for task ':sample:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':sample:debugRuntimeClasspath'.
> Could not find :unspecified:.
Required by:
project :sample > com.techyourchance:threadposter:1.0.0
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
It looks like Gradle finds my lib (because if I change to a non-existent version, say 2.0.0, then I get completely different error), but there is some problem with the artifact.
All the source code (both the lib and the sample app) can be found here. Specifically, here is build.gradle of the lib and that's the additional Gradle script that handles publication to Sonatype.
I've already spent two hours searching for each of the above error messages on the internet, but couldn't solve this issue so far.
Upvotes: 6
Views: 849
Reputation: 66
Skip dependencies with name 'unspecified' in your publish-maven.gradle.
withXml {
def dependenciesNode = asNode().appendNode('dependencies')
project.configurations.implementation.allDependencies.each {
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
Upvotes: 5