繁体   English   中英

NoClassDefFoundError:解析失败:Lokhttp3/logging/HttpLoggingInterceptor;

[英]NoClassDefFoundError: Failed resolution of: Lokhttp3/logging/HttpLoggingInterceptor;

我有一个 aar 库项目,我在一个示例项目中使用它。 我将相关库添加到 Maven 本地存储库。 当我检查 Pom 文件时,我可以将其视为 Okhttp3 / logging / HttpLoggingInterceptor 依赖项。 但我面临着屏幕下方的拍摄错误。 有什么建议?

在此处输入图片说明

我的父应用程序 gradle 文件看起来像上面的代码

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.2"

    defaultConfig {
        applicationId "com.example.deneme"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    dataBinding {
        enabled = true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.6'
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    implementation 'androidx.core:core-ktx:1.3.2'
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.3'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
    implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    implementation 'com.mylibrary:feature:1.0.15@aar'
    implementation 'com.android.support:multidex:1.0.3'

}

我的问题是,当生成 pom 文件时,它会错误地生成,实际上我在错误的子模块上遇到了问题。 在我修复了 pom 设置后,我的问题就解决了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM