Krishna B N
Krishna B N

Reputation: 75

java.lang.NoClassDefFoundError: okhttp3.OkHttpClient$Builder

I'm finding the same issue and tried with solution specified but still i'm getting the same error as below

java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/OkHttpClient$Builder;

Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.OkHttpClient$Builder" on path: DexPathList[[zip file "path" ]]

my gradle's is like

compile 'io.realm:android-adapters:1.4.0'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex:rxandroid:1.1.0' 
compile 'io.reactivex:rxjava:1.1.3'    


compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
compile 'com.squareup.okhttp3:okhttp:3.9.0'

I have my application classes which extends MultidexApplication.

Upvotes: 5

Views: 3155

Answers (1)

yogesh lokhande
yogesh lokhande

Reputation: 1275

Update your gradle file with this

android {
  defaultConfig {
    multiDexEnabled true
  }
}

Upvotes: -3

Related Questions