gpt4 book ai didi

java - 由 : java. 引起 lang.ClassNotFoundException: 没有找到类 "okhttp3.internal.Platform"

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:50:46 26 4
gpt4 key购买 nike

我试图为我找到一些东西,但它没有帮助我。

这是我的 gradle 文件:

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(path: ':slideDateTimePicke')
compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
transitive = true;
}
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
compile 'com.facebook.stetho:stetho-okhttp3:1.4.2'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.android.gms:play-services-vision:10.2.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.google.zxing:core:3.2.0'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.jakewharton:butterknife:8.5.1'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}

这是我的代码:

private static OkHttpClient createClient() {
return new OkHttpClient.Builder()
.addInterceptor(createLoggingInterceptor())
.build();
}

private static HttpLoggingInterceptor createLoggingInterceptor() {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(HttpLoggingInterceptor.Level.BASIC);
return logging;
}

哪里出错了?

最佳答案

添加这一行:

implementation 'com.squareup.okhttp3:okhttp:3.6.0'

并将com.squareup.okhttp3:logging-interceptor升级到3.6.0

可以看最新版本here

关于java - 由 : java. 引起 lang.ClassNotFoundException: 没有找到类 "okhttp3.internal.Platform",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43375721/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com