0

This question is not duplicate because I tried following solution.

Cannot resolve symbol HttpGet,HttpClient,HttpResponce in Android Studio

and

Can't resolve symbol 'Defaulthttpclient' and 'Httppost' in android solution in my application.

I add below 2 dependencies in my gradle file and Sync my project.

compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'

Still can't get solution.

after that I tried to import import org.apache.http.impl.client.DefaultHttpClient; manually. This solution can't help me.

Still not working. Please help me out.

build.gradel

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "<my Package>"
        minSdkVersion 8
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

}
Community
  • 1
  • 1
Chirag Savsani
  • 6,020
  • 4
  • 38
  • 74

0 Answers0