0

Очистка кэша с перезагрузкой не помогает. введите сюда описание изображения

> Task :app:checkDebugDuplicateClasses FAILED
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.google.android.gms.internal.measurement.zzhx found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.internal.measurement.zzmz found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.internal.measurement.zzna found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.internal.measurement.zznb found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.internal.measurement.zznc found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.internal.measurement.zznd found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.measurement.internal.zzga found in modules jetified-play-services-measurement-19.0.0-runtime (com.google.android.gms:play-services-measurement:19.0.0) and jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2)
     Duplicate class com.google.android.gms.measurement.internal.zzhe found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.measurement.internal.zzhf found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.measurement.internal.zzhg found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.measurement.internal.zzhh found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.measurement.internal.zzhi found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.measurement.internal.zzhj found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.measurement.internal.zzio found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)
     Duplicate class com.google.android.gms.measurement.internal.zzit found in modules jetified-play-services-measurement-base-20.1.2-runtime (com.google.android.gms:play-services-measurement-base:20.1.2) and jetified-play-services-measurement-impl-19.0.0-runtime (com.google.android.gms:play-services-measurement-impl:19.0.0)

Вот градл

    plugins {
    id 'com.onesignal.androidsdk.onesignal-gradle-plugin'
    id 'com.android.application'
    id 'com.google.gms.google-services'
}

android {
    compileSdkVersion 32
    defaultConfig {
        applicationId "com.alexfilms.cinema"
        minSdkVersion 21
        targetSdkVersion 32
        versionCode 21
        versionName "2.8"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    lintOptions {
        disable 'GradleDependency'
    }
    useLibrary 'org.apache.http.legacy'
}

/* IMPORTANT : Highly recommended to keep the library version
Be careful when update dependencies, different library version may caused error */
dependencies {
    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')

    //AndroidX and Google Support libraries
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'com.google.android.material:material:1.2.1'

    //exoplayer
    implementation 'com.google.android.exoplayer:exoplayer-core:2.17.0'
    implementation 'com.google.android.exoplayer:exoplayer-dash:2.17.0'
    implementation 'com.google.android.exoplayer:exoplayer-hls:2.17.0'
    implementation 'com.google.android.exoplayer:exoplayer-ui:2.17.0'
    implementation 'com.google.android.exoplayer:exoplayer-rtsp:2.17.0'

    //Analytics
    implementation platform('com.google.firebase:firebase-bom:28.2.1')
    implementation 'com.google.firebase:firebase-analytics'

    //Ad network
    implementation 'com.yandex.android:mobileads:5.6.0'
    implementation 'com.yandex.ads.mediation:mobileads-mytarget:5.16.2.0'
    implementation 'com.yandex.ads.mediation:mobileads-unityads:4.4.1.0'
    implementation 'com.yandex.ads.mediation:mobileads-admob:21.3.0.0'
    implementation 'com.yandex.ads.mediation:mobileads-applovin:11.6.0.0'
    implementation 'com.yandex.ads.mediation:mobileads-ironsource:7.2.4.1'
    implementation 'com.yandex.ads.mediation:mobileads-mintegral:16.3.11.0'
    implementation 'com.yandex.ads.mediation:mobileads-pangle:4.8.1.0.0'
    implementation 'com.my.target:mytarget-sdk:5.16.2'
    implementation 'com.google.android.gms:play-services-ads-lite:20.6.0'
    implementation 'com.google.android.play:core:1.10.0'

    //GDPR
    implementation 'com.google.android.ads.consent:consent-library:1.0.8'

    //Ad Network
    implementation 'com.github.solodroidx:solodroid-ads-sdk:1.3.5'

    //push notification
    implementation 'com.onesignal:OneSignal:4.4.1'

    //Rest API
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'

    //Image network
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.makeramen:roundedimageview:2.3.0'

    //ripple effect
    implementation 'com.balysv:material-ripple:1.0.2'

    //Time ago
    implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'

    //Multidex
    implementation 'androidx.multidex:multidex:2.0.1'

    //Shimmer effect
    implementation 'com.facebook.shimmer:shimmer:0.5.0'
}

Вот практически идентичный градл с зависимостями в приложение нет никаких дублей

plugins {
    id 'com.onesignal.androidsdk.onesignal-gradle-plugin'
    id 'com.android.application'
    id 'com.google.gms.google-services'
}

android {
    compileSdkVersion 32
    defaultConfig {
        applicationId "com.alexby.kinorevansh"
        minSdkVersion 21
        targetSdkVersion 32
        versionCode 38
        versionName '4.0'
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    lint {
        disable 'GradleDependency'
    }
}

/* IMPORTANT : Highly recommended to keep the library version
Be careful when update dependencies, different library version may caused error */
dependencies {
    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')

    implementation 'com.yandex.android:mobileads:5.6.0'
    implementation 'com.yandex.ads.mediation:mobileads-mytarget:5.16.2.0'
    implementation 'com.yandex.ads.mediation:mobileads-unityads:4.4.1.0'
    implementation 'com.yandex.ads.mediation:mobileads-admob:21.3.0.0'
    implementation 'com.yandex.ads.mediation:mobileads-applovin:11.6.0.0'
    implementation 'com.yandex.ads.mediation:mobileads-ironsource:7.2.4.1'
    implementation 'com.yandex.ads.mediation:mobileads-mintegral:16.3.11.0'
    implementation 'com.yandex.ads.mediation:mobileads-pangle:4.8.1.0.0'
    implementation 'com.my.target:mytarget-sdk:5.16.2'

    //AndroidX and Google Support libraries
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.lifecycle:lifecycle-process:2.3.1'
    implementation 'androidx.lifecycle:lifecycle-runtime:2.3.1'
    implementation 'androidx.lifecycle:lifecycle-common-java8:2.3.1'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.work:work-runtime:2.7.1'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'com.google.android.gms:play-services-ads-lite:20.6.0'
    implementation 'com.google.android.play:core:1.10.0'

    //exoplayer
    implementation 'com.google.android.exoplayer:exoplayer-core:2.17.0'
    implementation 'com.google.android.exoplayer:exoplayer-dash:2.17.0'
    implementation 'com.google.android.exoplayer:exoplayer-hls:2.17.0'
    implementation 'com.google.android.exoplayer:exoplayer-ui:2.17.0'
    implementation 'com.google.android.exoplayer:exoplayer-rtsp:2.17.0'

    //Analytics
    implementation platform('com.google.firebase:firebase-bom:30.1.0')
    implementation 'com.google.firebase:firebase-analytics'

    //Ad Network
    implementation 'com.github.solodroidx:solodroid-ads-sdk:1.3.5'

    //push notification
    implementation 'com.onesignal:OneSignal:4.6.7'

    //Rest API
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'

    //Image network
    implementation 'com.squareup.picasso:picasso:2.71828'

    //Multidex
    implementation 'androidx.multidex:multidex:2.0.1'

    //Shimmer effect
    implementation 'com.facebook.shimmer:shimmer:0.5.0'
}
3
  • 2
    покажите свой build.gradle
    – Andrew
    27 мар в 13:02
  • У вас какие-то конфликты библиотек, точнее - их версий. Вам надо или методом тыка менять версии библиотек, либо крайне внимательно изучить каждую на предмет наличия разных версий.
    – ЮрийСПб
    27 мар в 13:51
  • Обновил вопрос. 27 мар в 14:15

1 ответ 1

0

Проблема исчезла после изменения версии firebase аналитики с 28 на 30 версию.

Ваш ответ

Нажимая на кнопку «Отправить ответ», вы соглашаетесь с нашими условиями использования и подтверждаете, что прочитали и поняли наши политику конфиденциальности и нормы поведения.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.