Firebase身份验证不起作用,显示两行伪错误

时间:2019-08-09 23:01:36

标签: firebase flutter firebase-authentication

我正在使用Flutter,使用了几乎每个人都在使用的Firebase身份验证的典型用例。我一直无法使它正常工作。它只是在控制台上打印出来:

  

W / BiChannelGoogleApi(13340):[FirebaseAuth:] getGoogleApiForMethod()   返回的Gms:com.google.firebase.auth.api.internal.zzak@bf11a19   W / BiChannelGoogleApi(13340):[FirebaseAuth:] getGoogleApiForMethod()   返回的Gms:com.google.firebase.auth.api.internal.zzak@bf11a19

这是我的app / build.gradle

    def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
//apply plugin: 'com.google.firebase.firebase-perf'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "censored-for-privacy"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
            minifyEnabled true
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    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 'com.google.firebase:firebase-core:17.0.1' // Firebase core
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' // Firebase crashlytics
    //implementation 'com.google.firebase:firebase-perf:18.0.1' // Firebase performance
}

这是我的build.gradle

buildscript {
    repositories {
        google()
        jcenter()

        maven {
           url 'https://maven.fabric.io/public'
        }

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath 'com.google.gms:google-services:4.3.0'
        classpath 'io.fabric.tools:gradle:1.31.0'  // Crashlytics plugin
        // classpath 'com.google.firebase:perf-plugin:1.3.1'  // Performance Monitoring plugin

    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

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

我的google-services.json是最新的。我的SHA ID在Firebase上是最新的。我真的不知道为什么这会发生在我身上。任何帮助表示赞赏。

0 个答案:

没有答案