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

Download task fails with NoSuchFieldError #120

Closed
rhuffman opened this issue Aug 30, 2018 · 7 comments
Closed

Download task fails with NoSuchFieldError #120

rhuffman opened this issue Aug 30, 2018 · 7 comments
Labels

Comments

@rhuffman
Copy link

I am attempting to use the download task and it fails with NoSuchFieldError. It would appear that for some reason the Apache HttpComponents are screwy. I'm not sure to tell which version of is in use, though. It is unclear to me if this is a problem with my build or with the download plugin.

I have tried with both Gradle 4.9 and 4.10. Both fail with the same error.

Caused by: java.lang.NoSuchFieldError: INSTANCE
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:146)
        at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:964)
        at de.undercouch.gradle.tasks.download.internal.DefaultHttpClientFactory.createHttpClient(DefaultHttpClientFactory.java:86)
        at de.undercouch.gradle.tasks.download.internal.CachingHttpClientFactory.createHttpClient(CachingHttpClientFactory.java:43)
        at de.undercouch.gradle.tasks.download.DownloadAction.executeHttpProtocol(DownloadAction.java:247)
        at de.undercouch.gradle.tasks.download.DownloadAction.execute(DownloadAction.java:205)
        at de.undercouch.gradle.tasks.download.DownloadAction.execute(DownloadAction.java:157)
        at de.undercouch.gradle.tasks.download.Download.download(Download.java:90)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:801)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:768)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:174)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
        ... 31 more
@rhuffman
Copy link
Author

I wrote a simple build that uses the basic functionality of the download plugin and it works with Gradle 4.9. So this is obviously a problem with the Gradle build files we are using.

I cannot share the full build that is failing, but I will attempt to replicate the problem in my sample build. If I manage to do so I will let you know.

@michel-kraemer
Copy link
Owner

Thanks for reporting the issue. I did some refactoring and I think I finally solved the issue. If you like, you can try the latest snapshot. Use the following code to add it to your build file:

buildscript {
    repositories {
        jcenter()
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots/"
        }
    }
    dependencies {
        classpath 'de.undercouch:gradle-download-task:4.0.0-SNAPSHOT'
    }
}

apply plugin: 'de.undercouch.download'

Any feedback on whether this new version works for you or not would be appreciated. Thanks.

@runningcode
Copy link

Hey, thank you! I just tested out 4.0.0-SNAPSHOT and it seemed to resolve this issue for me. I was seeing the same stacktrace. Thanks!

@rhuffman
Copy link
Author

rhuffman commented Jan 8, 2019

Sorry, @michel-kraemer, I worked around the issue using an exec task with curl and moved on. Of course, that's not exactly portable. If I get around to switching back to the download task I'll let you know.

@michel-kraemer
Copy link
Owner

@runningcode Thanks for the feedback. I will release a new version soon.

@runningcode
Copy link

Any chance of a new release soon? :) Would love to not have to depend on a snapshot version!

@michel-kraemer
Copy link
Owner

gradle-download-task 4.0.0 has just been released.

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

No branches or pull requests

3 participants