[英]java.lang.NoClassDefFoundError: okhttp3.OkHttpClient$Builder
[英]java.lang.NoClassDefFoundError: okhttp3.OkHttpClient$Builder
我發現了同樣的問題並嘗試使用指定的解決方案,但我仍然得到與下面相同的錯誤
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" ]]
我的朋友就像
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
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.