GooglePlaces.<init>() has thrown a NoSuchFieldError

java.lang.NoSuchFieldError
Javadoc
Thrown if an application tries to access or modify a specified field of an object, and that object no longer has that field.

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed. @author unascribed @since JDK1.0

at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>
(source)
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>
(source)
at org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>
(source)
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>
(source)
at org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>
(source)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>
(source)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>
(source)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>
(source)
at org.apache.http.impl.client.HttpClientBuilder.build
(source)
at se.walkercrou.places.DefaultRequestHandler.<init>
at se.walkercrou.places.DefaultRequestHandler.<init>
at se.walkercrou.places.GooglePlaces.<init>
13 frames hidden

Typical Exception Messages

  1. No static field INSTANCE of type Lorg/apache/http/message/BasicLineFormatter; in class Lorg/apache/http/message/BasicLineFormatter; or its superclasses (declaration of 'org.apache.http.message.BasicLineFormatter' appears in /system/framework/ext.jar)
  2. org.apache.http.message.BasicLineFormatter.INSTANCE

Origin

HttpClientBuilder.build() has thrown a NoSuchFieldError

java.lang.NoSuchFieldError
10 frames hidden
org.apache.http.impl.client.HttpClientBuilder.build
28Web pages

Similar

Solution

rafael, 1 year ago

This is caused by a missing dependency, add it to your gradle file: dependencies { compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1' }

Check the source of this solution for more info

External results for this pattern (2)

  1. johnamcruzvia GitHub4 months ago
    No static field INSTANCE of type Lorg/apache/http/message/BasicLineFormatter; in class Lorg/apache/http/message/BasicLineFormatter; or its superclasses (declaration of 'org.apache.http.message.BasicLineFormatter' appears in /system/framework/ext.jar)
    Show stack trace
  2. vincentderiddervia GitHub2 years ago
    org.apache.http.message.BasicLineFormatter.INSTANCE
    Show stack trace