gpt4 book ai didi

java - NoClassDefFound错误: Failed resolution of: Lorg/apache/commons/logging/LogFactory

转载 作者:行者123 更新时间:2023-12-01 17:56:32 26 4
gpt4 key购买 nike

错误:

E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.azail.cart.debug, PID: 2403
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/commons/logging/LogFactory;
at org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:159)
at org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:178)
at com.azail.cart.connections.ConnectionClass.getRequest(ConnectionClass.java:240)
at com.azail.cart.connections.AppCacheConnections.getAllDetailsOfApp(AppCacheConnections.java:33)
at com.azail.cart.SplashActivity$1.doInBackground(SplashActivity.java:159)
at com.azail.cart.SplashActivity$1.doInBackground(SplashActivity.java:146)
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.commons.logging.LogFactory" on path: DexPathList[[zip file "/data/app/com.azail.cart.debug-a_b6vv5iBpFhYtgRldECJg==/base.apk"],nativeLibraryDirectories=[/data/app/com.azail.cart.debug-a_b6vv5iBpFhYtgRldECJg==/lib/arm64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:159) 
at org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:178) 
at com.azail.cart.connections.ConnectionClass.getRequest(ConnectionClass.java:240) 
  • 情况: 所以我调试并发现第一个api调用我在其中使用

    HttpClient httpclient = new DefaultHttpClient();

    下一步将转向 AsyncTask public AsyncTask(@Nullable Looper callbackLooper) { 的 catch block 并显示上述错误

    但是当我在 Android sdk 版本低于 28(即 27)的其他设备上尝试时,它工作正常,没有错误

    提前感谢您的帮助

最佳答案

您必须在 list 文件中添加这些行

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

关于java - NoClassDefFound错误: Failed resolution of: Lorg/apache/commons/logging/LogFactory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60705753/

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