Cannot resolve symbol HttpGet,HttpClient,DefaultHttpClient in Android Studio

后端 未结 4 1197
小蘑菇
小蘑菇 2020-12-20 06:29

Hi I am new for android in my app I am integrating with services so when I import all these jar files. It gives an error :

Cannot resolve symbol Ht

4条回答
  •  悲哀的现实
    2020-12-20 07:19

    HttpClient was deprecated in API Level 22 and removed in API Level 23. You have to use URLConnection.

    If you anyway need in 23, add this to your gradle::

    android {
       useLibrary 'org.apache.http.legacy'
    }
    

    NOTE: Instead, I would recommend using OkHttp.

提交回复
热议问题