//传入账户名和秘钥,返回一个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)
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。