首页 > 解决方案 > android studio中的gradle文件中的版本错误

问题描述

这是我的 gradle 文件。每当我尝试编译甚至进行干净构建时,都会遇到错误说明:

“请通过更新 google-services 插件的版本来解决版本冲突(有关最新版本的信息,请访问https://bintray.com/android/android-tools/com.google.gms.google-services/ ) 或将 com.google.android.gms 的版本更新为 16.0.3。"

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "studio.in.prakharshuka.atlastodo"
        minSdkVersion 22
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
//com.google.android.gms to 11.6.0.

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:16.0.3'
    implementation 'com.google.firebase:firebase-database:16.0.2'
    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'
}


apply plugin: 'com.google.gms.google-services'

请告诉我我做错了什么。我有连接到我的应用程序的 firebase 身份验证和数据库。

标签: androidandroid-studio

解决方案


这不应该导致错误,应该只是一个警告。但尽管如此,试试这个:

1) 将两个 firebase 依赖项保持在 16.0.2 版本。

2)添加implementation 'com.google.firebase:firebase-core:16.0.2'依赖。


推荐阅读