【问题标题】:i am getting an dependency resolution error but i'm not able to fix this我收到一个依赖解析错误,但我无法解决这个问题
【发布时间】:2021-07-09 07:46:55
【问题描述】:

这是错误

任务“:app:checkDebugDuplicateClasses”执行失败。

执行 com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable 时发生故障 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-compat-25.3.1-runtime (com.android.support:support -兼容:25.3.1) 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-compat-25.3.1-runtime (com.android.support :support-compat:25.3.1) 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-compat-25.3.1-runtime (com.android .support:support-compat:25.3.1) 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-compat-25.3.1-runtime (com.android.support:support -兼容:25.3.1) 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-compat-25.3.1-runtime (com.android.support :support-compat:25.3.1) 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-compat-25.3.1-runtime (com.android .support:support-compat:25.3.1) 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-compat-25.3.1-runtime (com.android.support:support -兼容:25.3.1) 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-compat-25.3.1-runtime (com.android.support:支持兼容:25.3.1) 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-compat-25.3.1-runtime (com.android.support :support-compat:25.3.1) 在模块 core-1.5.0-runtime (androidx.core:core:1.5.0) 和 support-compat-25.3.1-runtime (com.android.support :support-compat:25.3.1)

应用构建.gradle

plugins {
    id 'com.android.application'

}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'  // Google Services plugin


android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.example.phonematch"
        minSdkVersion 24
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

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

dependencies {

    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    //Google Firestore
    implementation platform('com.google.firebase:firebase-bom:28.2.0')
    implementation 'com.google.firebase:firebase-analytics'

    //----
    implementation 'com.google.firebase:firebase-auth:21.0.1'
    implementation 'com.google.firebase:firebase-storage:20.0.0'
    implementation 'com.google.firebase:firebase-messaging:22.0.0'

    implementation 'com.github.bumptech.glide:glide:4.12.0'
    implementation 'com.lorentzos.swipecards:library:1.0.9'
    implementation 'com.google.firebase:firebase-core:19.0.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'com.google.firebase:firebase-database:20.0.0'
    //navigation
    implementation 'com.github.ittianyu:BottomNavigationViewEx:1.2.4'

    //Circle ImageView
    implementation 'de.hdodenhof:circleimageview:3.1.0'
    implementation "com.github.dimorinny:show-case-card-view:0.0.1"

    implementation 'com.github.BakerJQ:Android-InfiniteCards:1.0.5'
}

【问题讨论】:

  • 您使用同一个库两次。一个在 libs 文件夹中,另一个通过依赖项导入,因此删除其中任何一个并尝试。它会工作
  • android.useAndroidX=true and android.enableJetifier=true in gradle.properties
  • 并为这个api提供一个版本implementation 'com.google.firebase:firebase-analytics'

标签: java android


【解决方案1】:

只需在 gradle.Proparties 中添加这两行

android.useAndroidX=true 
android.enableJetifier=true

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-01-07
    • 2021-05-31
    • 1970-01-01
    • 2013-01-23
    • 1970-01-01
    • 1970-01-01
    • 2016-04-28
    • 1970-01-01
    相关资源
    最近更新 更多