android - 如何更新谷歌服务插件?

标签 android

尝试运行应用程序时出现以下错误:

Error:Execution failed for task ':app:processDebugGoogleServices'. Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google- services/) or updating the version of com.google.android.gms to 9.2.0.

我换了不同的版本还是不行

这是我的build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
    applicationId "com.example.mher.loginregister"
    minSdkVersion 25
    targetSdkVersion 19
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-
 core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})


compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.firebase:firebase-auth:9.2.0'
compile 'com.google.firebase:firebase-database:10.0.1'
testCompile 'junit:junit:4.12'


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

2)

// Top-level build file where you can add configuration options common to 
all sub-projects/modules.

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.3'
    classpath 'com.google.gms:google-services:3.1.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
} 

allprojects {
repositories {
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

最佳答案

您需要使用相同版本的所有 Firebase 和 Google 依赖项。

使用这个:

compile 'com.google.firebase:firebase-auth:9.2.0'
compile 'com.google.firebase:firebase-database:9.2.0'

请注意 firebase-database 版本号的不同。

关于android - 如何更新谷歌服务插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44996766/

相关文章:

android - 具有默认对话框外观和感觉的自定义对话框 - 这可能吗?

java - 服务器与所有在线客户端/连接的 Netty 聊天

java - Sqlite 查询返回包含 0 行的游标

android - DELETE 请求无效,返回状态码 200

android - 在 sdk\ndk-bundle 文件夹中找不到 NDK-STACK.html

android - 如何同时在屏幕上绘制2个PNG图片

android - Android 4.0 如何在ListView 中实现类似滑动关闭的功能?

android - 安装 react-native-country-picker-modal 后出现内部错误

android - 如何获取我的应用程序的主要 Activity 类或类名?

android - 我们可以为 android-ndk r10c 中的共享库启用 pie(即位置独立可执行文件)吗?