我在build.gradle中的依赖关系(模块:app):
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-perf:16.0.0'
implementation 'com.google.firebase:firebase-analytics:16.0.0'
implementation 'com.google.firebase:firebase-firestore:17.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
implementation 'com.firebaseui:firebase-ui-database:4.0.0'
谷歌服务版 classpath'com.google.gms:google-services:4.0.1'
登录方式:
private fun launchSignInScreen() {
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(Arrays.asList(
AuthUI.IdpConfig.GoogleBuilder().build(),
AuthUI.IdpConfig.EmailBuilder().build())
).build(),
SIGN_IN_REQUEST_CODE)
}
每当我点按Google登录并选择Google帐户时,我都会收到Toast留言:
发生了未知错误。
是的,在Firebase信息中心中启用了“使用Google登录”
我怎么能让它发挥作用呢?