trying to upload large video using below code but getting this error<java.lang.NoSuchFieldError: org.apache.http.message.BasicHeaderValueFormatter.INSTANCE
>.
Your code could get rid off the deprecated code of MultipartEntity
and use MultipartEntityBuilder
. However the specific problem related here is that the core Android libraries conflict with the newly added ones. Also now there are maven repositories available. You could include the following code into the below file:
build.grade (Module:app)
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
It is pretty much simple to work the way around. Thanks to oleg for the answer here