关闭

java.lang.NoSuchFieldError: No static field INSTANCE

别叨叨 1年前 ⋅ 716 阅读

android中引入httpclient报错:

    java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; in class Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; or its superclasses (declaration of 'org.apache.http.conn.ssl.AllowAllHostnameVerifier' appears in /system/framework/framework.jar!classes4.dex)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:151)
        at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:977)

将httpclient替换为:

    implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'

全部评论: 0

    我有话说: