Android studio 中NameValuePair跟BasicNameValuePair 不能正常导包问题
针对一个post请求,android studio中无法正常导入以下两个包:
import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair;
Cannot resolve symbol NameValuePair
最后解决方案是:
在module文件中加入了
android { ... useLibrary 'org.apache.http.legacy' dependencies { ... compile 'org.apache.httpcomponents:httpcore:4.4.1' compile 'org.apache.httpcomponents:httpclient:4.5' } }
到此问题得到解决,如果还是报错出现如下&