Can't import org.apache.http.HttpResponse in Android Studio

后端 未结 6 1810
醉梦人生
醉梦人生 2020-12-03 06:53

I want to use these libraries in Android Studio:

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client         


        
6条回答
  •  情歌与酒
    2020-12-03 07:11

    HttpClient is deprecated in sdk 23.

    You have to move on URLConnection or down sdk to 22

    Still you need HttpClient with update gradle sdk 23

    You have to add the dependencies of HttpClient in app/gradle as

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile 'com.android.support:appcompat-v7:23.0.1'
    
        compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
        ...
    }
    

提交回复
热议问题