首页 > 解决方案 > gradle 同步失败

问题描述

因为我在应用程序级别的gradle 文件是:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.developer.pkcaller"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
    }
}
repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
}


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.1.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-iid:16.0.0'
    implementation 'com.google.firebase:firebase-messaging:17.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation files('libs/volley.jar')
    implementation 'com.firebaseui:firebase-ui:2.1.0'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.hbb20:ccp:1.7.2'
    implementation 'com.facebook.android:facebook-login:[4,5)'
    implementation 'com.squareup.picasso:picasso:2.3.2'
    implementation 'com.google.android.gms:play-services-analytics:16.0.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services-plus:15.0.1'
    //implementation 'com.google.android.gms:play-services:16.0.0'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.google.android.gms:play-services:12.0.1'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

我得到的错误如下:

错误:找不到 com.google.android.gms.internal.zzbgl 的 zzbgl 类文件

请帮我解决这个问题。我陷入了困境。请帮助我,我将非常感谢你。

标签: androidandroid-gradle-pluginbuild.gradle

解决方案


推荐阅读