开发者社区> 问答> 正文

AllowAllHostnameVerifier

//传入账户名和秘钥,返回一个profile配置文件 DefaultProfile profile = DefaultProfile.getProfile("cn-shanghai", accessKey, accessSecret);

    //传入配置文件,创建一个客户端对象
    IAcsClient client1 = new DefaultAcsClient(profile);
    //创建一个请求对象
    CommonRequest request1 = new CommonRequest();
  
  android studio运行报错,以下是错误提示:
  
  2020-09-21 16:53:54.556 13780-13780/com.example.bibangren E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.bibangren, PID: 13780
java.lang.NoSuchFieldError: No 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:classes2.dex)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:151)
    at com.aliyuncs.http.clients.ApacheHttpClient.createSSLConnectionSocketFactory(ApacheHttpClient.java:120)
    at com.aliyuncs.http.clients.ApacheHttpClient.initConnectionManager(ApacheHttpClient.java:134)
    at com.aliyuncs.http.clients.ApacheHttpClient.init(ApacheHttpClient.java:184)
    at com.aliyuncs.http.HttpClientFactory.buildClient(HttpClientFactory.java:41)
    at com.aliyuncs.DefaultAcsClient.<init>(DefaultAcsClient.java:89)
    at com.aliyuncs.DefaultAcsClient.<init>(DefaultAcsClient.java:78)
    at com.example.bibangren.MainActivity.onCreate(MainActivity.java:29)
    at android.app.Activity.performCreate(Activity.java:6662)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
    at android.app.ActivityThread.-wrap12(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

展开
收起
1097843567668389 2020-09-21 17:22:13 1309 0
1 条回答
写回答
取消 提交回答
  • 请问这个是否解决了啊,要怎么解决呢

    2020-11-01 01:22:52
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载