错误原因:java.lang.NoClassDefFoundError: com.squareup.okhttp.OkHttpClient
java.lang.NoClassDefFoundError: com.squareup.okhttp.OkHttpClient
at com.alibaba.sdk.android.oss.internal.InternalRequestOperation.(InternalRequestOperation.java:77)
at com.alibaba.sdk.android.oss.OSSClient.(OSSClient.java:96)
at com.alibaba.sdk.android.oss.OSSClient.(OSSClient.java:73)
at com.zhilai.terminal.app.ui.activity.SignInThreeActivity.upload(SignInThreeActivity.java:236)
at com.zhilai.terminal.app.ui.activity.SignInThreeActivity.onActivityResult(SignInThreeActivity.java:188)
at android.app.Activity.dispatchActivityResult(Activity.java:5192)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3137)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3184)
at android.app.ActivityThread.access$1100(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
报错定位在:
OSS oss = new OSSClient(getApplicationContext(), AppConstants.ENDPOINT, credentialProvider);
这句话上
问题是我已经关联上android SDK中的 okhttp-2.7.0.jar,okio-1.6.0.jar,aliyun-oss-sdk-android-2.0.3.jar三个jar包
程序在编译时没错 运行时报错
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。