更新播放服务后出现错误“程序类型已存在:com.google.android.gms.internal.measurement.zzabo”

我将播放服务依赖项更新到15.0.0版,并在我的app.gradle中添加了play-services-safetynet.在那之后,我总是得到

Program type already present: com.google.android.gms.internal.measurement.zzabo
Message{kind=ERROR, text=Program type already present: com.google.android.gms.internal.measurement.zzabo, sources=[Unknown source file], tool name=Optional.of(D8)}

在构建应用程序时.这是我的app.build:

apply plugin: 'com.android.application'

android {
    signingConfigs {
    }
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "XXXXXXX"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "0.0.0.1"
        setProperty("archivesBaseName", "XXXXXXX-$versionName")
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/notice.txt'
    }
    productFlavors {
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')

    compile 'com.android.support:support-v4:27.1.1'
    compile 'com.android.support:design:27.1.1'
    compile 'com.android.support:appcompat-v7:27.1.1'
    compile 'com.android.support:recyclerview-v7:27.1.1'
    compile 'com.android.support.constraint:constraint-layout:1.1.0'
    compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2'
    compile 'com.koushikdutta.urlimageviewhelper:urlimageviewhelper:1.0.4'
    implementation 'com.google.firebase:firebase-core:15.0.0'
    implementation 'com.google.firebase:firebase-messaging:15.0.0'
    implementation 'com.google.firebase:firebase-appindexing:15.0.0'
    implementation 'com.google.android.gms:play-services-location:15.0.0'
    implementation 'com.google.android.gms:play-services-safetynet:15.0.0'
    compile 'org.kefirsf:kefirbb:1.5'
    compile 'org.osmdroid:osmdroid-android:6.0.1'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

解决方法:

就我而言,我必须在项目的build.gradle中将Firebase从版本15.0.0更新到15.0.2:

dependencies {
    ...
    implementation "com.google.firebase:firebase-messaging:15.0.2"
    ...
}

然后在app的build.gradle中我不得不将google-services从3.1.1更新到3.3.0:

dependencies {
    ...
    classpath 'com.google.gms:google-services:3.3.0'
    ...
}
上一篇:c-内联调用always_inline’__m128i _mm_cvtepu8_epi32(__ m128i)’失败:目标特定选项不匹配_mm_cvtepu8_epi32(__m128i __X)


下一篇:VS 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案