I need to exclude a dependency in gradle


(Mindaugas Nakrošis) #1

Hello,

I am building an android application and am using recaptcha and easywsdl repositories. These both repositories contain okhttp and okio jars and I get error while starting app that duplicate classes exist. However, these are not the same. If I exclude okhttp from the project (added by recaptcha repository) recaptcha doesn’t have particular methods that are described in okhttp.jar added by recaptcha.

android { configurations{ all*.exclude module: 'okhttp' all*.exclude module: 'okio' } } repositories { mavenCentral() } dependencies { compile 'android.lib.recaptcha:reCAPTCHA:+' compile 'com.android.support:multidex:1.0.0' compile project(':MKLibs') compile 'com.loopj.android:android-async-http:1.4.9' compile 'com.facebook.android:facebook-android-sdk:4.6.0' compile 'com.android.support:appcompat-v7:19.1.0' compile 'com.jjoe64:graphview:3.1.3' compile 'com.android.support:gridlayout-v7:20.0.0' compile 'com.google.android.gms:play-services-auth:8.4.0' dependencies { compile project(':intercom-sdk-base') compile project(':intercom-sdk-gcm') compile 'com.google.android.gms:play-services-gcm:8.4.0' } compile files('libs/easywsdl/ksoap2-android-assembly-3.6.1-jar-with-dependencies.jar')


(Learner) #2

I am also having the same issue… How did you solve it…???