android studio DefaultHttpClient, HttpClient import ¿¡·¯ |
|
|
 |
8³â Àü |
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
À§ÀÇ °Íµé ¿¡·¯
can not resolve symbol defaulthttpclient
HttpClient is not supported any more in sdk 23. You have to use URLConnection or downgrade to sdk 22 (compile 'com.android.support:appcompat-v7:22.2.0')
If you need sdk 23, add this to your gradle:
android {
useLibrary 'org.apache.http.legacy'
}
You also may try to download and include HttpClient jar directly into your project or use OkHttpinstead
can not resolve symbol httpclient
Just add this in your dependencies
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'
Finally
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'
}
I hope it will helps you |
|
̵̧ : 280 |
̵̧
¸ñ·Ï
|
|