Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/221.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java.lang.NoClassDefFoundError:okhttp3.OkHttpClient$Builder_Java_Android_Retrofit_Rx Java2_Okhttp3 - Fatal编程技术网

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帮助了我