java.lang.NoSuchMethodError

No direct method <init>(Ljava/lang/String;Lorg/apache/http/entity/ContentType;)V in class Lorg/apache/http/entity/StringEntity; or its super classes (declaration of 'org.apache.http.entity.StringEntity' appears in /system/framework/org.apache.http.legacy.boot.jar)

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web14799

  • No direct method <init>(Ljava/lang/String;Lorg/apache/http/entity/ContentType;)V in class Lorg/apache/http/entity/StringEntity; or its super classes (declaration of 'org.apache.http.entity.StringEntity' appears in /system/framework/org.apache.http.legacy.boot.jar)
  • via Coderanch by Sai Sheela Pidatala, 1 month ago
    No direct method <init>(Ljava/io/File;)V in class Lorg/apache/http/entity/FileEntity; or its super classes (declaration of 'org.apache.http.entity.FileEntity' appears in /system/framework/org.apache.http.legacy.boot.jar)
  • via Stack Overflow by sai pidatala
    , 1 month ago
    No direct method <init>(Ljava/io/File;)V in class Lorg/apache/http/entity/FileEntity; or its super classes (declaration of 'org.apache.http.entity.FileEntity' appears in /system/framework/org.apache.http.legacy.boot.jar)
  • Stack trace

    • java.lang.NoSuchMethodError: No direct method <init>(Ljava/lang/String;Lorg/apache/http/entity/ContentType;)V in class Lorg/apache/http/entity/StringEntity; or its super classes (declaration of 'org.apache.http.entity.StringEntity' appears in /system/framework/org.apache.http.legacy.boot.jar) at com.github.tomakehurst.wiremock.client.HttpAdminClient.postJsonAssertOkAndReturnBody(HttpAdminClient.java:235) at com.github.tomakehurst.wiremock.client.HttpAdminClient.addStubMapping(HttpAdminClient.java:104) at com.github.tomakehurst.wiremock.client.WireMock.register(WireMock.java:229) at com.github.tomakehurst.wiremock.client.WireMock.register(WireMock.java:225) at com.github.tomakehurst.wiremock.client.WireMock.givenThat(WireMock.java:100) at com.github.tomakehurst.wiremock.client.WireMock.stubFor(WireMock.java:104) at com.handstandsam.httpmocking.tests.wiremock.WireMockActivityInstrumentationTestCase2.testWiremock(WireMockActivityInstrumentationTestCase2.java:70) at java.lang.reflect.Method.invoke(Native Method) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at com.github.tomakehurst.wiremock.junit.WireMockRule$1.evaluate(WireMockRule.java:72) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:54) at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:240) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You’re the first here who have seen this exception.