gpt4 book ai didi

android - java.lang.NoClassDefFoundError : Failed resolution of: Lorg/apache/http/params/BasicHttpParams;

转载 作者:行者123 更新时间:2023-12-01 10:19:37 24 4
gpt4 key购买 nike

我已将 Android 应用程序从 26 升级到 28 SDK。

它在 23 - 27 版本中运行良好。

但是新版本会在 SDK 28 中崩溃。

这是异常堆栈:

java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:354)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/params/BasicHttpParams;
at com.deepnet.andmob5.util.UtilsYang.getNewHttpClient(UtilsYang.java:163)
at com.deepnet.andmob5.util.UtilsYang.makeRequest(UtilsYang.java:103)
at com.deepnet.andmob5.util.UtilsYang.sendHTTPPost(UtilsYang.java:426)
at com.deepnet.andmob5.threads.MyAsyncTask.doInBackground(MyAsyncTask.java:52)
at com.deepnet.andmob5.threads.MyAsyncTask.doInBackground(MyAsyncTask.java:22)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:764) 
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.params.BasicHttpParams" on path: DexPathList[[zip file "/data/app/com.deepnet.andmob5-lZYwyb5I5Tn71C5uAAbAOA==/base.apk"],nativeLibraryDirectories=[/data/app/com.deepnet.andmob5-lZYwyb5I5Tn71C5uAAbAOA==/lib/x86, /data/app/com.deepnet.andmob5-lZYwyb5I5Tn71C5uAAbAOA==/base.apk!/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)

请帮我。

最佳答案

如果您使用的是 Apache HTTP 客户端,请在 AndroidManifest.xml 中添加以下内容:
refer this

<uses-library android:name="org.apache.http.legacy" android:required="false"/>

关于android - java.lang.NoClassDefFoundError : Failed resolution of: Lorg/apache/http/params/BasicHttpParams;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54806903/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com