NoClassDefFoundError exception in android stuidio

前端 未结 2 653
甜味超标
甜味超标 2021-01-02 09:05

Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/impl/client/DefaultHttpClient

I am not able to resolve below error :

相关标签:
2条回答
  • 2021-01-02 09:23

    You are getting this error because your app uses the legacy org.apache.http.legacy client and your app's targetSdkVersion is set to 28 or higher.

    Consider using HttpURLConnection or lowering your targetSdkVersion in build.gradle.

    0 讨论(0)
  • 2021-01-02 09:32

    Add the following to your manifest file under 'application':

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

    https://developer.android.com/about/versions/pie/android-9.0-changes-28#apache-p

    0 讨论(0)
提交回复
热议问题