After updating my Android Studio to 3.5 version. I'm getting error this error:
Duplicate class org.apache.http.Consts found in modules
httpclient-android-4.3.5.1.jar
(org.apache.httpcomponents:httpclient-android:4.3.5.1) and
httpcore-4.3.2.jar (org.apache.httpcomponents:httpcore:4.3.2)
Duplicate class org.apache.http.ContentTooLongException found in
modules httpclient-android-4.3.5.1.jar
(org.apache.httpcomponents:httpclient-android:4.3.5.1) and
httpcore-4.3.2.jar (org.apache.httpcomponents:httpcore:4.3.2)
Duplicate class org.apache.http.HttpConnectionFactory found in modules
httpclient-android-4.3.5.1.jar
(org.apache.httpcomponents:httpclient-android:4.3.5.1) and
httpcore-4.3.2.jar (org.apache.httpcomponents:httpcore:4.3.2)
Duplicate class org.apache.http.HttpHeaders found in modules
httpclient-android-4.3.5.1.jar
(org.apache.httpcomponents:httpclient-android:4.3.5.1) and
httpcore-4.3.2.jar (org.apache.httpcomponents:httpcore:4.3.2)
Duplicate class org.apache.http.MessageConstraintException found in
modules httpclient-android-4.3.5.1.jar
(org.apache.httpcomponents:httpclient-android:4.3.5.1) and
httpcore-4.3.2.jar (org.apache.httpcomponents:httpcore:4.3.2)
Duplicate class org.apache.http.TruncatedChunkException found in
modules httpclient-android-4.3.5.1.jar
(org.apache.httpcomponents:httpclient-android:4.3.5.1) and
httpcore-4.3.2.jar (org.apache.httpcomponents:httpcore:4.3.2)
Duplicate class org.apache.http.annotation.GuardedBy found in modules
httpclient-android-4.3.5.1.jar
(org.apache.httpcomponents:httpclient-android:4.3.5.1) and
httpcore-4.3.2.jar (org.apache.httpcomponents:httpcore:4.3.2)
Duplicate class org.apache.http.annotation.Immutable found in modules
httpclient-android-4.3.5.1.jar
(org.apache.httpcomponents:httpclient-android:4.3.5.1) and
httpcore-4.3.2.jar (org.apache.httpcomponents:httpcore:4.3.2)
Resolved by excluding the duplicates from the implemented libraries in your gradle file:
implementation ('org.apache.httpcomponents:httpclient-android:4.3.5.1') {
exclude group: 'org.apache.http'
}
implementation ('org.apache.httpcomponents:httpcore:4.3.2') {
exclude group: 'org.apache.http'
}
If you require more help post your gradle file in its entirety.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With