tangguo

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

java

而从默认改变我的代码,我收到此错误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


阅读 822

收藏
2020-10-14

共1个答案

小编典典

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

2020-10-14