How can I fix this issues while compiling release build in Android Studio 3.0 RC2
Error:Error: commons-logging defines classes that conflict with cl
I fixed this with a clean/rebuild. Also be sure to have annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0' in your gradle for Glide.
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
compile 'com.github.recruit-lifestyle:FloatingView:2.2'
compile 'com.dropbox.core:dropbox-core-sdk:3.0.5'
compile 'com.squareup.okio:okio:1.13.0'
compile 'com.squareup.okhttp3:okhttp:3.9.0'
compile 'com.github.bumptech.glide:glide:4.2.0'
compile 'com.opencsv:opencsv:4.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:preference-v7:26.1.0'
compile 'com.android.support:preference-v14:26.1.0'
compile 'com.google.android.gms:play-services-vision:11.4.2'
compile 'com.google.android.gms:play-services-places:11.4.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'
}
Add to build.gradle located in app module
configurations {
all {
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
}
add to app/build.gradle
configurations {
all {
exclude module: 'httpclient'
exclude module: 'commons-logging'
}
}
In my case I use this dependency:
compile 'com.github.nkzawa:socket.io-client:0.3.0'
The json is wrong. I changed
implementation('com.github.nkzawa:socket.io-client:0.3.0',{
exclude group:'org.json',module: 'json'
})
The same error i fixed by this piece of code...
android {
...
configurations {
all {
exclude module: 'httpclient'
exclude module: 'json'
exclude group: 'org.apache.httpcomponents'
}
}
...
}
In my case the first issue (commons-logging) was solved excluding it from opencsv import:
implementation('com.opencsv:opencsv:4.5') {
exclude group: 'commons-logging'
}