无法在Android Studio 2.1.1中解析符号HttpGet,HttpClient,HttpResponce

时间:2016-06-20 05:29:16

标签: php

我的朋友在这里

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.example.user.connector"
        minSdkVersion 15
        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.3.0'
}

1 个答案:

答案 0 :(得分:0)

您需要添加依赖项才能使用它们,将其添加到您的gradle

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

请记住,在SDK 23 HTTPClient中,不推荐使用其他内容,您也可以通过将目标sdk更改为低于23来解决此问题