Cannot resolve symbol HttpGet,HttpClient,HttpResponce in Android Studio

前端 未结 12 1939
深忆病人
深忆病人 2020-12-02 12:47

I just copy all the jar files of Http but Android Studio cann\'t import all these jar files.It gives an error : Cannot resolve symbol HttpGe

12条回答
  •  有刺的猬
    2020-12-02 13:40

    That is just in SDK 23, Httpclient and others are deprecated. You can correct it by changing the target SDK version like below:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 22
        buildToolsVersion "22.0.1"
    
        defaultConfig {
            applicationId "vahid.hoseini.com.testclient"
            minSdkVersion 10
            targetSdkVersion 22
            versionCode 1
            versionName "1.0"
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'),    'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:22.1.1'
    }
    

提交回复
热议问题