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.
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
- Apache’s independent packaging of HttpClient for Android
- OkHttp (my recommendation)
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).