Android Kotlin编译器错误:无法访问OkHttpClient

Android Kotlin编译器错误:无法访问OkHttpClient,android,okhttp,Android,Okhttp,Kotlin编译器的下一个问题是: class file for okhttp3.OkHttpClient not found Consult the following stack trace for details. 我用谷歌搜索了一下,但没有任何解决办法 这是我在gradle的依赖项: dependencies { // Modules implementation project(':domain') // Kotlin implement

Kotlin编译器的下一个问题是:

class file for okhttp3.OkHttpClient not found 
Consult the following stack trace for details.  
我用谷歌搜索了一下,但没有任何解决办法

这是我在gradle的依赖项:

    dependencies {
    // Modules
    implementation project(':domain')
    // Kotlin
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    // Network
    implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
    implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
    implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
    implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
    implementation "com.facebook.stetho:stetho-okhttp3:$stethoVersion"
    // DI
    implementation "com.google.dagger:dagger:$daggerVersion"
    implementation "com.google.dagger:dagger-android-support:$daggerAdnroidVersion"
    implementation "javax.inject:javax.inject:$javaxVersion"
    kapt "com.google.dagger:dagger-compiler:$daggerVersion"
    // Testing
    testImplementation "junit:junit:$junitVersion"
    testImplementation "com.android.support.test:runner:$runnerVersion"
    testImplementation "com.android.support.test.espresso:espresso-core:$espressoVersion"
    testImplementation "org.mockito:mockito-core:$mockitoCore"
    testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:$mockitoKotlin"
    testImplementation "android.arch.core:core-testing:$arch_components_vers"
    androidTestImplementation "com.android.support:support-annotations:$androidAnnotationsVersion"
    androidTestImplementation "com.android.support.test:runner:$androidRunnerVersion"
    androidTestImplementation "com.android.support.test:rules:$androidRunnerVersion"
}
我可以在代码中使用这个类-这个类没有错误


但当我尝试运行应用程序时,我发现了这个问题。我如何修复它?

您使用的是proguard还是任何模糊处理库?@DevMike01此问题实际为
useProguard=false
@Artem您能解决此问题吗?@anshul是,但是我忘了我是如何做到的)我通过正确提供匕首依赖项来修复它。你使用proguard还是任何模糊处理库?@DevMike01此问题实际用于
useProguard=false
@Artem你能解决此问题吗?@anshul是的,但我忘了我是如何做到的)我通过正确提供匕首依赖项来修复它。