我不确定这里发生了什么,我拉了我最近更新的repo,每次打开应用程序在模拟器上调试它时,当应用程序加载主要时,我会得到E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED
屏幕。但是,这在今天之前没有发生过,所以我不知道会发生什么变化吗?我从Firebase控制台中删除了该应用程序并通过Firebase Assistant重新添加了应用程序,但这也没有解决吗?我包括了我的build.grade文件,但我不确定我还需要查看什么,任何帮助将不胜感激。
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.android.projectrc"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.wdullaer:materialdatetimepicker:3.4.0'
implementation "org.jetbrains.anko:anko:$anko_version"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.github.bumptech.glide:glide:4.2.0'
implementation 'com.google.firebase:firebase-auth:11.0.4'
implementation 'com.google.firebase:firebase-database:11.0.4'
implementation 'com.google.firebase:firebase-storage:11.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
我的情况下的问题是,模拟器未连接到Internet,似乎没有像iOS模拟器那样隐含连接。
使用模拟器没有 Google Play将导致此错误。
检查模拟器中是否有Internet连接。我遇到了同样的问题,并且像这样运行模拟器对我有帮助:
emulator -avd <Avd name> -dns-server 8.8.8.8
我的猜测是已发布了新版本的Google Play库,您的测试设备/模拟器需要更新他当前安装的版本。
在您的设备/模拟器上检查Google Play商店应用程序,进行更新,您应该很好!
为Android Emulator求解的冷启动设备
我面临同样的问题。我当时使用了与API 28的Nexus,这是货运的,我无法更新Google Play。
我必须使用API 24创建另一个模拟器,并从模拟器中更新Google Play。现在,电子邮件auth和firestore有效,但是Facebook和Google登录也无法正常工作。
我遇到了同样的问题。
Android Studio提示我说"2019-06-06 09:16:04.540 4415-4502/com.google.android.youtube E/FirebaseInstanceId: Token retrieval failed: AUTHENTICATION_FAILED"
。
最后,我卸载了模拟器并安装了一个与API 26的新联系。问题最终解决了。
我能够通过擦除Android Studio中的模拟器数据来解决我的问题。您可以尝试一下。
另外,我的仿真器是API 31
转到
Project
-&gt;Dockerfile
-&GT;根据SDKMANAGER platforms;android-28
。
检查参考。