Caused By: Java.lang.noclassdeffounderror: Org.apache.http.util.args
conn.addRequestProperty(entity.getContentType().getName(), entity.getContentType().getValue()); It crashes on samsung device running operating system version 4.1. While on Marsh
Solution 1:
Apache http client was removed since marshmallow.
See here Apache HTTP Client Removal
Solution (about embed client at all):
android {
useLibrary 'org.apache.http.legacy'
}
UPDATED: About the particular problem see related post
Btw, in my project I can't add apache http client as a library, because of package name conflict with embed cliend. I have to use this or as described here
Solution 2:
Please include useLibrary url like this
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
Solution 3:
For Marshmallow Apache HTTP Client Removal
android {
useLibrary 'org.apache.http.legacy'
}
try this once
app/build/libs Files >> Project Structure >> Dependencies >> + >> File Dependencies >> and then change it to provided instead of compile (compile will cause a java exit with nonzero value 1 if you are importing too much jars.
Samsung has customised the sdk so there are channces to include more jars..
Post a Comment for "Caused By: Java.lang.noclassdeffounderror: Org.apache.http.util.args"