FirebaseAuth:getGoogleApiForMethod() 返回 Gms:com.google.firebase.auth.api.internal.zzal@489 [英] FirebaseAuth: getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal@489

查看:19
本文介绍了FirebaseAuth:getGoogleApiForMethod() 返回 Gms:com.google.firebase.auth.api.internal.zzal@489的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试进行电话身份验证时,出现以下错误.

When I am trying to phone authntication I am getting below error.

W/BiChannelGoogleApi(12340): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal@489

我在 Stackverflow 和其他地方检查了同样的错误,但没有在任何地方得到正确的解决方案.

I have checked the same error in Stackverflow and other places but not getting proper solution anywhere.

pubspec.yml 中的更改

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  firebase_core: ^0.3.0+2  //new
  firebase_auth: ^0.8.1+1  //new

注意 -- 添加了//新来突出显示我在上面文件中添加的行.

Note -- added //New to highlite the lines which i have added in above file.

app/build.gradle

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

android/build.gradle

android/build.gradle

buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.2.0'
    }
}

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
}

android/app/build.gradle

android/app/build.gradle

.....
android {
    compileSdkVersion 28
    .....
    defaultConfig {
        ....
        minSdkVersion 21
        targetSdkVersion 27
        ......
    }
    .....
    dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    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-auth:16.1.0'
//    implementation 'androidx.core:core-ktx:1.0.0'
}

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

android/app/gradle.properties

android/app/gradle.properties

org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true

我使用的是 AndroidX.

I am using AndroidX.

推荐答案

我最近解决了这个问题.基本上这个错误有很多原因,因为当 FirebaseAuth 入口点执行失败时会返回这个错误.我遇到的这个错误的原因之一是我的模拟器没有连接到互联网因此,还要在模拟器内打开互联网.

I recently solved this issue. Basically there are many reason for this this error because this error returns when FirebaseAuth entry point failed to execute. One of the reason of getting this error which I faced is My Emulator was't connected to Internet So turn the internet on inside emulator also.

这篇关于FirebaseAuth:getGoogleApiForMethod() 返回 Gms:com.google.firebase.auth.api.internal.zzal@489的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆