Android Studio 无法引用org.apache.http解决办法

sdk 23以上不再支持org.apache.http,你可以将降到sdk22 然后在gradle中添加
compile 'com.android.support:appcompat-v7:22.2.0'


非要用高版本sdk,则添加

android {
    useLibrary 'org.apache.http.legacy'
}

也可以用OkHttp



原文:
down vote accepted

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

你可能感兴趣的:(Android开发)