Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NameValuePair Error "NameValuePair cannot be resolved to a type" [duplicate]

Tags:

android

php

mysql

I m new in android and i m creating a project like this tutorial and its showing the error like the following photo.Please help me out of this.enter image description here

like image 476
Than Htut Avatar asked Jan 08 '23 15:01

Than Htut


1 Answers

Your project's compileSdkVersion is set to 23. Apache's HttpClient library was removed from the Android SDK in API Level 23.

If you change your compileSdkVersion to 21, your app will compile cleanly. Or, there is a workaround to continue using HttpClient in Android 6.0 with Android Studio. However, for long-term development, you really need to move to something else for an HTTP API. That "something else" could be:

  • the built-in classic Java HttpUrlConnection
  • Apache's independent packaging of HttpClient for Android
  • OkHttp (my recommendation)
  • AndroidAsync

Or, depending upon the nature of your HTTP work, you might choose a library that supports higher-order operations (e.g., Retrofit for Web service APIs).

like image 130
CommonsWare Avatar answered Jan 24 '23 13:01

CommonsWare