Wednesday, February 15, 2017

cannot-resolve-symbol-httpget-httpclient-httpresponce-in-android-studio

Tags

Buka pada gradle


Just add this in your dependencies
compile 'org.apache.httpcomponents:httpcore:4.4.1'compile 'org.apache.httpcomponents:httpclient:4.5'compile "cz.msebera.android:httpclient:4.4.1.2"
Finally
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'    })
    compile 'com.android.support:appcompat-v7:24.2.1'    testCompile 'junit:junit:4.12'// di sini yaa    compile 'org.apache.httpcomponents:httpcore:4.4.1'    compile 'org.apache.httpcomponents:httpclient:4.5'    compile "cz.msebera.android:httpclient:4.4.1.2"}
Edit
You can add
 android {
    useLibrary 'org.apache.http.legacy'
         }
di bawah nya 

android {
    compileSdkVersion 24    buildToolsVersion "25.0.0"    defaultConfig {
        applicationId "com.heru.xmlparser"        minSdkVersion 15        targetSdkVersion 24        versionCode 1        versionName "1.0"        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"    }
    buildTypes {
        release {
            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }
    }
//Di sini tarok nya
    useLibrary 'org.apache.http.legacy'}


EmoticonEmoticon