【问题标题】:Found an After including Google AdMob dependency "Duplicate class com.google.android.gms.common.api.internal.zza found in modules classes.jar"在包含 Google AdMob 依赖项后发现“在模块 classes.jar 中找到重复的类 com.google.android.gms.common.api.internal.zza”
【发布时间】:2019-07-03 06:23:04
【问题描述】:

一切都是正确的,当我集成 Google Ad Mob 依赖 implementation 'com.google.android.gms:play-services-ads:18.0.0' 时,我收到了这个错误

项目级 Gradle:

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

模块级分级:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.demo.something"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    //Facebook account kit
    implementation 'com.facebook.android:account-kit-sdk:4.39.0'

    //sdp and ssp for dimension and font size
    implementation 'com.intuit.sdp:sdp-android:1.0.6'
    implementation 'com.intuit.ssp:ssp-android:1.0.6'

    //Lottie Animation
    implementation 'com.airbnb.android:lottie:2.8.0'

    //Android Fast Networking for APIs
    implementation 'com.amitshekhar.android:jackson-android-networking:1.0.2'

    //Process Dialog
    implementation 'com.wang.avi:library:2.1.3'

    //Scratch Card
    implementation 'com.github.myinnos:AndroidScratchCard:v1.0'

    //Google AdMob
    implementation 'com.google.android.gms:play-services-ads:17.0.0'
}

在模块 classes.jar (com.google.android.gms:play-services-base:11.8.0) 和 classes.jar ( com.google.android.gms:play-services-basement:16.0.1)

【问题讨论】:

    标签: android android-gradle-plugin androidx


    【解决方案1】:

    我已经检查了您在我的项目中的依赖关系,并发现了 AndroidScratchCard 的其他错误。播放服务没有问题。

    您可以尝试重建您的项目。

    【讨论】:

    • 它不起作用,即使我尝试使缓存无效并重新启动
    猜你喜欢
    • 1970-01-01
    • 2019-11-03
    • 1970-01-01
    • 2020-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-17
    相关资源
    最近更新 更多