HttpClient的不是在我的Andr​​oid 1.4的工作室工作 [英] HttpClient not working in my android studio 1.4

查看:206
本文介绍了HttpClient的不是在我的Andr​​oid 1.4的工作室工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先对不起我的英语不好,我的新到Android 1.4的工作室,我在HttpClient的

得到错误

错误

<$p$p><$c$c>C:\\Users\\madhu\\AndroidStudioProjects\\LoginAndsign\\app\\src\\main\\java\\com\\login\\loginandsign\\SimpleHttpClient.java错误:(27 20)错误:无法找到符号类的HttpClient错误:(34 20)错误:无法找到符号类的HttpClient错误:(36 31)错误:无法找到符号类DefaultHttpClient错误:(40 13)错误:无法找到符号变量ConnManagerParams
错误:(57 13)错误:无法找到符号类的HttpClient错误:(58 13)错误:无法找到符号类HttpPost错误:(58 36)错误:无法找到符号类HttpPost错误:(59 13)错误:无法找到符号类UrlEn codedFormEntity错误:(59 51)错误:无法找到符号类UrlEn codedFormEntity错误:(96 13)错误:无法找到符号类的HttpClient错误:(97,13)错误:无法找到符号类HTTPGET错误:(97,35)错误:无法找到符号类HTTPGET

我在下面的依赖,但仍然显示出同样的错误。

  {相关性
编译com.google.android.gms:播放服务:+'
编译org.apache.httpcomponents:HttpClient的:4.2.6
编译org.apache.httpcomponents:httpmime:4.2.6
编译文件(库/ core.jar添加')
}


解决方案

您需要初始化 useLibrary'org.apache.http.legacy

请查看 <一个href=\"http://stackoverflow.com/questions/32153318/httpclient-wont-import-in-android-studio\">HttpClient不会Android Studio中导入

 安卓{
    compileSdkVersion 23
    buildToolsVersion '23 .0.1
    defaultConfig {
        //的minSdkVersion你集
        targetSdkVersion 23
        版本code 11 //此致
        的versionName0.1//此致
    }依赖{
编译com.google.android.gms:播放服务:7.8.0
编译org.apache.httpcomponents:httpmime:4.2.6
编译org.apache.httpcomponents:HttpClient的:4.5'
编译文件(库/ core.jar添加')
}

清理重建,重新启动同步您的项目。

First sorry for my bad English I am new to android studio 1.4 ,I am getting error in HttpClient

Error

C:\Users\madhu\AndroidStudioProjects\LoginAndsign\app\src\main\java\com\login\loginandsign\SimpleHttpClient.java

Error:(27, 20) error: cannot find symbol class HttpClient

Error:(34, 20) error: cannot find symbol class HttpClient

Error:(36, 31) error: cannot find symbol class DefaultHttpClient

Error:(40, 13) error: cannot find symbol variable ConnManagerParams


Error:(57, 13) error: cannot find symbol class HttpClient

Error:(58, 13) error: cannot find symbol class HttpPost

Error:(58, 36) error: cannot find symbol class HttpPost

Error:(59, 13) error: cannot find symbol class UrlEncodedFormEntity

Error:(59, 51) error: cannot find symbol class UrlEncodedFormEntity

Error:(96, 13) error: cannot find symbol class HttpClient

Error:(97, 13) error: cannot find symbol class HttpGet

Error:(97, 35) error: cannot find symbol class HttpGet

I added below dependency but still it showing same error

dependencies {
compile 'com.google.android.gms:play-services:+'
compile 'org.apache.httpcomponents:httpclient:4.2.6'
compile 'org.apache.httpcomponents:httpmime:4.2.6'
compile files('libs/core.jar')
}

解决方案

You need to initialize useLibrary 'org.apache.http.legacy'

Please check HttpClient won't import in Android Studio

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.1' 


    defaultConfig {
        minSdkVersion // set yours 
        targetSdkVersion 23
        versionCode 11 //Yours
        versionName "0.1" // Yours
    }

dependencies {
compile 'com.google.android.gms:play-services:7.8.0'
compile 'org.apache.httpcomponents:httpmime:4.2.6'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile files('libs/core.jar')
}

Then Clean-Rebuild-Restart-Sync Your Project .

这篇关于HttpClient的不是在我的Andr​​oid 1.4的工作室工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆