NoSuchMethodError when using RESTEasyClient on Android : <p>I am developing an Android app and using a library that in turn depends on <code>RESTEasyClient</code>. When using the library at runtime, I get a <code>NoSuchMethodError</code>:</p>

<pre><code>java.lang.NoSuchMethodError: No direct method &lt;init&gt;(Ljavax/net/ssl/SSLContext;Lorg/apache/http/conn/ssl/X509HostnameVerifier;)V in class Lorg/apache/http/conn/ssl/SSLSocketFactory; or its super classes (declaration of 'org.apache.http.conn.ssl.SSLSocketFactory' appears in /system/framework/ext.jar)
                      at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.initDefaultEngine(ResteasyClientBuilder.java:418)
                      at org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.build(ResteasyClientBuilder.java:333)
</code></pre>

<p>As I understand it, this is because of an incompatibility with Android's implementation of Apache HttpClient. Searching online, I have found various solutions revolving around including <code>org.apache.httpconnections:httpclient</code> in the gradle dependencies and adding <code>compile.exclude module: httpclient</code> (to resolve the resulting conflict) in several variations. I have tried all these and invariably run into either an error from gradle or the <code>NoSuchMethodError</code>mentioned above.</p>

<p>Is it possible to successfully use <code>RESTEasyClient</code> on Android? What steps do I need to take to enable this?</p>
