java.lang.NoClassDefFoundError:okhttp3.OkHttpClient$Builder
我正在查找并尝试指定的解决方案,但仍然得到与下面相同的错误java.lang.NoClassDefFoundError:okhttp3.OkHttpClient$Builder,java,android,retrofit,rx-java2,okhttp3,Java,Android,Retrofit,Rx Java2,Okhttp3,我正在查找并尝试指定的解决方案,但仍然得到与下面相同的错误 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" ]]
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" ]]
我的gradle's就像
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'
我有扩展MultidexApplication的应用程序类。用这个更新你的gradle文件
android {
defaultConfig {
multiDexEnabled true
}
}
你试过清理/重建/重新启动android studio吗?我试过清理和重建。试过重新启动android studio,会有帮助吗?我不知道。试试看,让我知道。@Vucko dint帮助了我