Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from components.android error: Cannot get property 'allDependencies' on null object #15

Closed
tonisives opened this issue Apr 6, 2018 · 3 comments

Comments

@tonisives
Copy link

tonisives commented Apr 6, 2018

Hello, I have released a version of my .aar before and everything was successful. Now, if I go back to to the commit I made the release from, I get this error.

Cannot get property 'allDependencies' on null object

It comes from the publication line from components.android

publishing {
    publications {
        aar(MavenPublication) {
            from components.android
        }
    }
}

It works when I specify the artifact like this:

aar(MavenPublication) {
    //from components.android
    groupId "${artifactProperties.groupId}"
    version "${artifactProperties.version}"
    artifact("$buildDir/outputs/aar/hmkit-android-release.aar")

    pom.withXml {
        def dependenciesNode = asNode().appendNode('dependencies')

        //Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
        configurations.compile.allDependencies.each {
            def dependencyNode = dependenciesNode.appendNode('dependency')
            dependencyNode.appendNode('groupId', it.group)
            dependencyNode.appendNode('artifactId', it.name)
            dependencyNode.appendNode('version', it.version)
        }
    }
}

But this way the pom file does not have any dependencies.

Why do I get this null object error? Why did it work before and not now?

Im using gradle 4.6 and this release is from an Android projects module.

Off-topic: Why could it be that the dependencies loop is not adding to the pom?

@tonisives
Copy link
Author

tonisives commented Apr 6, 2018

This null error disappears if I delete
apply plugin: 'com.jfrog.artifactory'.

But then I get another error Could not find method artifactory()

Maybe artifactory plugin update broke this? I am using classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4+" so im getting automatic updates.

@tonisives
Copy link
Author

Ok, if I use
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.5.0'
then the error disappears and I can make the release.

@nhaarman
Copy link

Well, downgrading isn't really fixing the problem, is it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants