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

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

Closed
grantland opened this issue Jul 28, 2015 · 5 comments

Comments

@grantland
Copy link

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
Copy link

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

@kt3k
Copy link
Owner

kt3k commented Sep 11, 2015

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
Copy link
Owner

kt3k commented Jan 29, 2016

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"
}

@kt3k kt3k closed this as completed Jan 29, 2016
stkent added a commit to stkent/amplify that referenced this issue Feb 9, 2016
@sdoward
Copy link

sdoward commented Mar 24, 2016

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

@mg6maciej
Copy link

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:
mg6maciej/fluffy-octo-rotary-phone@3f43543
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:
mg6maciej/fluffy-octo-rotary-phone@6f306f1
but still same error:
https://travis-ci.org/mg6maciej/fluffy-octo-rotary-phone/builds/202597250

Continue to use 2.5.0-x.

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

5 participants