我正在使用Firebase身份验证通过电话号码进行注册。但是没有发送任何短信。
我收到此错误
W / BiChannelGoogleApi:[FirebaseAuth:] getGoogleApiForMethod() 返回的Gms:com.google.firebase.auth.api.internal.zzak@d5a4a6d
我的gradle文件
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
implementation 'com.google.android.material:material:1.1.0-alpha07'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0-alpha01'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.13-beta-3'
androidTestImplementation 'androidx.test:runner:1.3.0-alpha01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha01'
}
答案 0 :(得分:0)
我了解您错过了在应用程序中设置Firebase的功能。
遵循here
中的整个过程确保在应用程序的模块(应用程序级)目录中具有 google-services.json 文件。
您的根级别(项目级别)Gradle文件(build.gradle)必须包含以下行。
buildscript {
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
dependencies {
// ...
// Add the following line:
classpath 'com.google.gms:google-services:4.2.0' // Google Services plugin
}
}
allprojects {
// ...
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
// ...
}
}
然后在模块(应用程序级)Gradle文件(通常为app / build.gradle)中,在文件底部添加一行。
apply plugin: 'com.android.application'
android {
// ...
}
// Add the following line to the bottom of the file:
apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
在模块(应用程序级)Gradle文件(通常为app / build.gradle)中,添加核心Firebase SDK的依赖项:
dependencies {
// ...
implementation 'com.google.firebase:firebase-core:17.0.0'
// Getting a "Could not find" error? Make sure that you've added
// Google's Maven repository to your root-level build.gradle file
}