commons-logging defines classes that conflict with classes now provided by Android after Android Studio Update
Add to build.gradle
located in app module
configurations {
all {
exclude module: 'httpclient'
}
}
Error: android defines classes that conflict with classes now provided by Android , when we start to generate release build
Problem
How to see which dependency is creating conflicts. It is same like shooting in dark.
Solution
Some AS plugin that will show you which projects dependency hierarchy. You can find where issue presents exactly and solve that.
Gradle View is an Android Studio plugin that you can install and show dependency hierarchy.
Methods Count is another plugin, it also shows dependency tree.
commons-validator and error commons-logging defines classes that conflict with classes now provided by Android
The problem is with commons-logging. So it must be excluded.
Add the following code in app/build.gradle. It should work.
configurations {
all {
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
}
Error while compiling release build in Android Studio 3.0 RC2
Add to build.gradle located in app module
configurations {
all {
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
}
Android app level build.gradle giving Error : httpclient defines classes that conflict with classes now provided by Android
I solved it by adding implementation "org.apache.httpcomponents:httpcore:4.4.13"
and excluding group: 'org.apache.httpcomponents', module: 'httpclient'
Check this:
implementation('org.apache.httpcomponents:httpmime:4.5.12') {
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
implementation "org.apache.httpcomponents:httpcore:4.4.13"
Related Topics
Android Studio Cannot Resolve R in Imported Project
Savedinstancestate Is Always Null in Fragment
Android Repeat Action on Pressing and Holding a Button
Opening Infowindow Automatically When Adding Marker Google Maps V2 Android
Android - How to Set an Alarm to a Specific Date
Android Sax Parser Not Getting Full Text from Between Tags
Strange Behavior of Android Videoview - "Can't Play Video"
Android Studio- "Sdk Tools Directory Is Missing"
Change Shape Solid Color at Runtime Inside Drawable Xml Used as Background
Android Volley Sending Data Twice
Android:Textallcaps="False" Not Working for Tablayout Design Support
What Is the Android UI Thread Stack Size Limit and How to Overcome It
Android Webview Anchor Link (Jump Link) Not Working
Lint Error "Do Not Treat Position as Fixed; Only Use Immediately..."
Android Sdk Content Loader Failing with Nullpointerexception