2 回答

TA貢獻(xiàn)1865條經(jīng)驗(yàn) 獲得超7個(gè)贊
錯(cuò)誤是由于使用 Amazon kindle fire HD 進(jìn)行測試所致。kindle 使用沒有 Google play 服務(wù)的 FireOS,因此出現(xiàn)錯(cuò)誤。

TA貢獻(xiàn)1895條經(jīng)驗(yàn) 獲得超3個(gè)贊
您必須檢查其中一項(xiàng)。1. SHA1 提供給您的應(yīng)用程序。2. 您的根應(yīng)用程序上必須有 google-services.json。3. 配置你的依賴。4. 確保您啟用了電子郵件/密碼驗(yàn)證。在 firebase 控制臺(tái)身份驗(yàn)證選項(xiàng)卡中。
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
// ...
implementation 'com.google.firebase:firebase-core:16.0.6'
// Getting a "Could not find" error? Make sure you have
// added the Google maven respository to your root build.gradle
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
這在構(gòu)建
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:4.2.0' // google-services plugin
}
}
allprojects {
// ...
repositories {
google() // Google's Maven repository
// ...
}
}
供參考。你的代碼沒有錯(cuò)。只是設(shè)置的東西。
添加回答
舉報(bào)