Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed resolution of: Lorg/apache/http/client/methods/HttpPost

Working httpPost in all android device with 8.1 and below but when run in android 9.0 to getting error like below,

Failed resolution of: Lorg/apache/http/client/methods/HttpPost;
        at com.makemusiccount.android.retrofit.RestClient.Execute(RestClient.java:99)
        at com.makemusiccount.android.activity.LoginActivity$Login.doInBackground(LoginActivity.java:390)
        at com.makemusiccount.android.activity.LoginActivity$Login.doInBackground(LoginActivity.java:368)
        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.client.methods.HttpPost" on path: DexPathList[[zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/base.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_dependencies_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_resources_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_0_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_1_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_2_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_3_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_4_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_5_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_6_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_7_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_8_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/lib/x86, /system/lib]]
like image 731
Gautam Surani Avatar asked Sep 28 '18 05:09

Gautam Surani


1 Answers

add this line in your application tag of your manifest.xml

<uses-library android:name="org.apache.http.legacy" android:required="false"/>
like image 117
pratik vekariya Avatar answered Nov 15 '22 16:11

pratik vekariya