Reputation: 14711
A few days ago I moved my Eclipse project from one folder to another and set up the dependencies again.
The project now builds perfectly and the app runs until it gets to this piece of code:
HttpResponse httpResponse = httpClient.execute(httpPost);
Where I get this error:
Caused by: java.lang.NoSuchMethodError: org.apache.http.impl.client.DefaultHttpClient.execute
In the libs
folder I have these jars:
httpclient-4.3.5.jar
httpcore-4.3.2.jar
httpmime-4.3.5.jar
And here is how my Order and export looks like:
And my libraries tab
EDIT: Another thing I tried was downloading the lastest httpcore, httpclient and httpmime and replacing the jars in the libs folder
And I also added them as Add External Jars
in Libraries tab of Configure Build path
Upvotes: 0
Views: 1122
Reputation: 14711
I resolved my problem by downgrading to versions 4.1 or httpcore, httpclient and httpmime.
Upvotes: 1
Reputation: 3692
I don't have much idea about how you could resolve the error, especially since you seem to be using Eclipse, but as an alternative, you could try OkHttp library. It has very good performance and you could easily modify your codebase with this change.
Upvotes: 0