当前位置: 首页 > 面试题库 >

java.lang.NoClassDefFoundError:com.squareup.okhttp.MediaType

傅宏恺
2023-03-14
问题内容

而从默认改变我的代码,我收到此错误HTTPClient来OkHTTP。通过网络搜索了所有内容,但仍未解决。

我OkHTTP从这里尝试了相同的库,也尝试了依赖关系, 但是错误仍然相同。

请帮我解决这个问题。

错误是:

01-01 22:03:18.038: E/AndroidRuntime(1460): java.lang.RuntimeException: An error occured while executing doInBackground() 01-01 22:03:18.038: E/AndroidRuntime(1460): at android.os.AsyncTask$3.done(AsyncTask.java:300) 01-01 22:03:18.038: E/AndroidRuntime(1460): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) 01-01 22:03:18.038: E/AndroidRuntime(1460): at java.util.concurrent.FutureTask.setException(FutureTask.java:222) 01-01 22:03:18.038: E/AndroidRuntime(1460): at java.util.concurrent.FutureTask.run(FutureTask.java:242) 01-01 22:03:18.038: E/AndroidRuntime(1460): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 01-01 22:03:18.038: E/AndroidRuntime(1460): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 01-01 22:03:18.038: E/AndroidRuntime(1460): at java.lang.Thread.run(Thread.java:841) 01-01 22:03:18.038: E/AndroidRuntime(1460): Caused by: java.lang.NoClassDefFoundError: com.squareup.okhttp.MediaType 01-01 22:03:18.038: E/AndroidRuntime(1460): at com.kaverisoft.servicemanager.api.RemoteAPI.<clinit>(RemoteAPI.java:340) 01-01 22:03:18.038: E/AndroidRuntime(1460): at com.kaverisoft.servicemanager.BusinessCodeActivity$ActivationCodeConfirmation.doInBackground(BusinessCodeActivity.java:314) 01-01 22:03:18.038: E/AndroidRuntime(1460): at com.kaverisoft.servicemanager.BusinessCodeActivity$ActivationCodeConfirmation.doInBackground(BusinessCodeActivity.java:1) 01-01 22:03:18.038: E/AndroidRuntime(1460): at android.os.AsyncTask$2.call(AsyncTask.java:288) 01-01 22:03:18.038: E/AndroidRuntime(1460): at java.util.concurrent.FutureTask.run(FutureTask.java:237) 01-01 22:03:18.038: E/AndroidRuntime(1460): ... 3 more


问题答案:

我通过制作Multidex应用程序解决了该问题,请参阅此链接了解如何制作Multidex应用程序。



 类似资料:

相关阅读

相关文章

相关问答