0

I am using android studio, while trying to use HttpPost,HttpClient it says cannot find symbol. i surfed on internet and found that if we are at api level 23 we need to add some dependence so i added.

useLibrary 'org.apache.http.legacy'

and

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'

}

in my build.gradle file. but even after adding this the same problem exist. any other solution.

soham more
  • 21
  • 1
  • 8
  • http://stackoverflow.com/questions/32607257/cannot-resolve-symbol-httpget-httpclient-httpresponce-in-android-studio – IntelliJ Amiya Jun 09 '16 at 07:10
  • if you are building app with target sdk 23 than you can't find it because android has removed it. you have to use httpurlconnection rather httppost – J.D. Jun 09 '16 at 07:11

1 Answers1

0

If you are having problem with dependency then download the jar from the following link and add it to your libs folder. Then right click on that jar then select Add as Library.

https://hc.apache.org/downloads.cgi

Kumar M
  • 994
  • 6
  • 21