简体   繁体   English

使用Android上的Google登录进行身份验证会构建它并出错

[英]Authenticate Using Google Sign-In on Android build it and error

I follow Fierbase consol instruction to add Authenticate Using Google Sign-In on Android to my app but I can't build it and error appear say to fix the version conflict either by updating the version of the google-services plugin or updating the version of com.google.android.gms to 10.0.1. 我按照Fierbase consol指令将Android上的“使用Google登录进行身份验证”添加到我的应用程序中,但是无法构建它,并且出现错误说要通过更新google-services插件的版本或更新的版本来解决版本冲突com.google.android.gms到10.0.1。 , can any one help ?? ,任何人都可以帮忙吗?

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
    applicationId "com.mohamed71.fierbasebackendcourse"
    minSdkVersion 19
    targetSdkVersion 25
    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.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.google.android.gms:play-services-auth:11.0.2'
compile 'com.google.firebase:firebase-core:11.0.2'
testCompile 'junit:junit:4.12'
}


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

the other build.gradle code 其他build.gradle代码

// 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:databse版本

com.google.firebase:firebase-database:11.0.2

I found the error because 我发现错误是因为

 compile 'com.google.firebase:firebase-database:10.0.1'  

and I replace it with 我将其替换为

compile 'com.google.firebase:firebase-database:11.0.2'

and error is gone . 错误消失了。 but the strange is that I add firebase-database from Tool >> firebase but it didnt load the last vertion !! 但是奇怪的是我从工具>> firebase添加了firebase-database,但是它没有加载最后一个版本!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM