嗨,我是我的应用程序中的android新手,正在与服务集成,因此当我导入所有这些jar文件时.它给出一个错误:
Cannot resolve symbol httpGet,httpClIEnt,DefaulthttpClIEnt.
import org.apache.http.httpentity;import org.apache.http.httpResponse;import org.apache.http.clIEnt.httpClIEnt;import org.apache.http.clIEnt.methods.httpGet;import org.apache.http.impl.clIEnt.DefaulthttpClIEnt;
我的构建gradle:-
dependencIEs { compile filetree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.androID.support:appcompat-v7:23.0.1' compile 'com.androID.support:design:23.0.1' compile 'org.apache.httpcomponents:httpcore:4.4.1' compile 'org.apache.httpcomponents:httpclIEnt:4.5'}
解决方法:
httpClIEnt在API级别22中已弃用,在API级别23中已删除.您必须使用URLConnection.
如果您仍然需要23,请将其添加到gradle ::
androID { uselibrary 'org.apache.http.legacy'}
注意:相反,我建议使用OkHttp.
总结以上是内存溢出为你收集整理的无法在Android Studio中解析符号HttpGet,HttpClient,DefaultHttpClient全部内容,希望文章能够帮你解决无法在Android Studio中解析符号HttpGet,HttpClient,DefaultHttpClient所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)