kt3k / coveralls-gradle-plugin

👨‍🔧 gradle plugin for coveralls
https://plugins.gradle.org/plugin/com.github.kt3k.coveralls
MIT License
253 stars 54 forks source link

java.lang.NoSuchMethodError: org.apache.http.entity.mime.content.ByteArrayBody.<init>([BLorg/apache/http/entity/ContentType;Ljava/lang/String;)V #47

Closed grantland closed 8 years ago

grantland commented 9 years ago

Similar issue to #27 and #45. It only successfully works with 2.0.1x, but not 2.4.0 (latest). Is this intentional?

Full stack trace:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':coveralls'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:310)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.NoSuchMethodError: org.apache.http.entity.mime.content.ByteArrayBody.<init>([BLorg/apache/http/entity/ContentType;Ljava/lang/String;)V
    at org.apache.http.entity.mime.MultipartEntityBuilder.addBinaryBody(MultipartEntityBuilder.java:131)
    at org.apache.http.entity.mime.MultipartEntityBuilder$addBinaryBody$0.call(Unknown Source)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask$_postJsonToUrl_closure1.doCall(CoverallsTask.groovy:43)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:432)
    at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:366)
    at groovyx.net.http.HTTPBuilder$request.call(Unknown Source)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask.postJsonToUrl(CoverallsTask.groovy:41)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask$postJsonToUrl.callCurrent(Unknown Source)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask.coverallsAction(CoverallsTask.groovy:132)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:589)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:572)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 14 more
stephanenicolas commented 9 years ago

+1. It would be nice to add a unit test here in the plugin.

kt3k commented 9 years ago

Sorry for the incovenience!

I released v2.4.0x as a workaround version. Please try this version if you see the above error.

I don't understand this error for the moment. This seems caused by the use of the incompatible version of httpmime. This plugin depends on httpmime-4.3, but in some cases gradle runtime seems using httpmime-4.1 ignoring its dependency. I don't know the reason why this happens in some situations.

kt3k commented 8 years ago

Use v2.5.0x if you still see the above error.

Alternatively if you use the new syntax for plugin application like the following, you must be able to avoid the above error.

plugins {
  id "com.github.kt3k.coveralls" version "2.5.0"
}
sdoward commented 8 years ago

I am still experiencing this issue in version 2.6.3, perhaps we should reopen this issue?

mg6maciej commented 7 years ago

Still an issue with 2.8.1.

Execution failed for task ':app:coveralls'.
> org.apache.http.entity.mime.content.ByteArrayBody.<init>([BLorg/apache/http/entity/ContentType;Ljava/lang/String;)V

Here is relevant code change: https://github.com/mg6maciej/fluffy-octo-rotary-phone/commit/3f435432077edc091d0c39ff3116555c9306ed0d and travis output (look at the end of it): https://travis-ci.org/mg6maciej/fluffy-octo-rotary-phone/builds/202581862

I also tried the new apply plugin syntax: https://github.com/mg6maciej/fluffy-octo-rotary-phone/commit/6f306f1639bfeec11084d98dbd8d4852d457c644 but still same error: https://travis-ci.org/mg6maciej/fluffy-octo-rotary-phone/builds/202597250

Continue to use 2.5.0-x.