0

"The import org.apache.http.util cannot be resolved" when I import the android project. I tried to look other sample answers but I still don't quiet understand.I referred to below stackoverflow link for answer also: The import org.apache.http.client cannot be resolved error when I update sdk to M

Please provide the answer with screenshots if possible.Thank you so much.

Community
  • 1
  • 1
user5545809
  • 101
  • 1
  • 7
  • Since official Eclipse support is ending in 19 days, please have a plan to move to a supported environment. In the duplicate question, "change your `compileSdkVersion` to 21" refers to Android Studio. IIRC, the equivalent in Eclipse is to right-click over your project in the Package Explorer, choose Properties > Android from the context menu, and in there set your build target to 21 or lower. – CommonsWare Dec 12 '15 at 16:05
  • apache http library have been Deprecated long back. you better start using Volley library , asynchttpClient loopj(http://loopj.com/android-async-http/) libraries. – HourGlass Dec 12 '15 at 16:20
  • @CommonsWare..Sry for late reply and thanks for the suggestion. – user5545809 Dec 13 '15 at 02:58
  • @HourGlas..thz for the advice. – user5545809 Dec 13 '15 at 02:58

1 Answers1

0

Add this to your build.gradle

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

Or you can use solution mentioned in this post apache http imports not working

Community
  • 1
  • 1
Raza Ali Poonja
  • 1,086
  • 8
  • 16
  • @RAP....I added the httpclient4.0.3 jar file into my library and it's working. Here is the link for future references. http://www.java2s.com/Code/Jar/h/Downloadhttpclient403jar.htm – user5545809 Dec 13 '15 at 02:59