![](/img/trans.png)
[英]NoClassDefFoundError: Failed resolution of: 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.