我试图通过电子邮件和密码使用Firebase Auth服务。当我点击注册时,我在模拟器上收到一条警告:
"Update Google Play services : Firebase Auth won't run unless you update Google Play services"
当我查看日志时,我可以阅读这两行:
DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
GooglePlayServicesUtil: Google Play services out of date. Requires 9256000 but found 9080480
在SDK Manager中,Google Play服务是最新的。我怀疑它是模拟器的一个问题,它不知何时是最新的。
我使用的模拟器:Nexus 5X API 21(使用Google API)
有什么想法吗?谢谢!
答案 0 :(得分:26)
在您的帖子中,您说,在SDK管理器中,Google Play服务是最新的。
独立SDK管理器底部的 Extras 部分中显示的Google Play服务版本对模拟器使用的版本没有影响。模拟器在配置为包含某些特定版本的Play服务的系统映像上运行,该服务并不总是最新版本。
您应确认已下载最新的模拟器图像。这些列在每个API级别下的独立SDK管理器中,其名称以 System Image 结尾。仔细检查您是否已下载最新版本的 Goggle API ...系统映像文件。然后,您需要重新创建模拟器以使用更新的图像。
在我看到您的问题之前,我没有最新版本,并尝试在Nexus 5X API 21仿真器上运行Firebase Auth 9.0.2。它失败的消息类似于您报告的消息。然后我下载了最新的图像(rev 12),现在我能够成功运行。
答案 1 :(得分:8)
此类未来问题的最佳方式是。
打开你的模拟器去设置>应用> Google Play服务
你会发现你的AVD使用的女巫版
现在您知道AVD使用的号码只需使用任何
版本等于或低于你的gradle
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
// Fire base
compile 'com.google.firebase:firebase-auth:9.0.1'
compile 'com.google.firebase:firebase-database:9.0.1'
compile 'com.google.android.gms:play-services-auth:9.0.1'
}
apply plugin: 'com.google.gms.google-services'
这项工作对我来说,我希望它有所帮助!
答案 2 :(得分:0)
我通过更新Google Play服务解决了这个问题。最初在8.0,我将其更新为11.0。
答案 3 :(得分:-1)
只需将manifest.xml和gradle构建集minSDKversion设置为15..i即可解决我的问题。