Firebase Auth无法正常工作 - 模拟器上的“更新Google Play服务”消息(Android)

时间:2021-11-16 15:22:46

I'm trying to use the Firebase Auth service with email and password. When I click on register I got an alert on the emulator that says :

我正在尝试使用Firebase Auth服务和电子邮件和密码。当我点击注册时,我在模拟器上收到一条提示:

"Update Google Play services : Firebase Auth won't run unless you update Google Play services"

When I look in the logs, I can read those 2 lines :

当我查看日志时,我可以阅读这两行:

DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
GooglePlayServicesUtil: Google Play services out of date. Requires 9256000 but found 9080480 

In the SDK Manager, Google Play services are up to date. I suspect it's a problem with the emulator, which somehow isn't up to date.

在SDK Manager中,Google Play服务是最新的。我怀疑它是模拟器的一个问题,它不知何时是最新的。

The emulator I'm using : Nexus 5X API 21 (with Google API)

我正在使用的模拟器:Nexus 5X API 21(使用Google API)

Any idea? Thanks!

任何想法?谢谢!

4 个解决方案

#1


25  

In your post you say, In the SDK Manager, Google Play services are up to date.

在您的帖子中,您说,在SDK管理器中,Google Play服务是最新的。

The version of Google Play Services shown in the Extras section at the bottom of the Standalone SDK Manager has no effect on the version used by an emulator. The emulators run on system images configured to contain some particular version of Play Services, which is not always the latest.

Standalone SDK Manager底部的Extras部分中显示的Google Play服务版本对模拟器使用的版本没有影响。模拟器在系统映像上运行,系统映像配置为包含某些特定版本的Play服务,这并不总是最新版本。

You should confirm that you have downloaded the latest emulator images. These are listed in the Standalone SDK Manager under each API level and have names that end with System Image. Double check that you have downloaded the lastest versions of the Goggle APIs...System Image files. You will then need to recreate your emulator to use the updated image.

您应确认已下载最新的模拟器图像。这些列在每个API级别下的独立SDK管理器中,并具有以系统映像结尾的名称。仔细检查您是否已下载最新版本的Goggle API ...系统映像文件。然后,您需要重新创建模拟器以使用更新的图像。

Until I saw your question, I did not have the latest versions and tried running Firebase Auth 9.0.2 on a Nexus 5X API 21 emulator. It failed with a message similar to what you reported. I then downloaded the latest image (rev 12) and am now able to run successfully.

在我看到您的问题之前,我没有最新版本,并尝试在Nexus 5X API 21仿真器上运行Firebase Auth 9.0.2。它失败的消息类似于您报告的消息。然后我下载了最新的图像(rev 12),现在我可以成功运行了。

#2


8  

best way for future problems like this is .

这样的未来问题的最好方法是。

open you emulator go to settings > apps > Google Play Services

打开模拟器转到设置>应用> Google Play服务

you will find witch version your AVD is using

你会发现你的AVD使用的女巫版本

Firebase Auth无法正常工作 - 模拟器上的“更新Google Play服务”消息(Android)

now that you know the number your AVD is using just use any

既然您知道AVD正在使用的号码,那就使用任何号码

version equal or bellow in your gradle

版本等于或低于你的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'

this work for me , i hope it helps !

这项工作对我来说,我希望它有所帮助!

#3


0  

I solved this problem by updating Google Play services. Initially at 8.0 and I updated it to 11.0.

我通过更新Google Play服务解决了这个问题。最初在8.0,我将其更新为11.0。

#4


-1  

Just go t manifest.xml and gradle build set minSDKversion to 15..i have solved my problem with this.

只需将manifest.xml和gradle构建集minSDKversion设置为15..i即可解决我的问题。

#1


25  

In your post you say, In the SDK Manager, Google Play services are up to date.

在您的帖子中,您说,在SDK管理器中,Google Play服务是最新的。

The version of Google Play Services shown in the Extras section at the bottom of the Standalone SDK Manager has no effect on the version used by an emulator. The emulators run on system images configured to contain some particular version of Play Services, which is not always the latest.

Standalone SDK Manager底部的Extras部分中显示的Google Play服务版本对模拟器使用的版本没有影响。模拟器在系统映像上运行,系统映像配置为包含某些特定版本的Play服务,这并不总是最新版本。

You should confirm that you have downloaded the latest emulator images. These are listed in the Standalone SDK Manager under each API level and have names that end with System Image. Double check that you have downloaded the lastest versions of the Goggle APIs...System Image files. You will then need to recreate your emulator to use the updated image.

您应确认已下载最新的模拟器图像。这些列在每个API级别下的独立SDK管理器中,并具有以系统映像结尾的名称。仔细检查您是否已下载最新版本的Goggle API ...系统映像文件。然后,您需要重新创建模拟器以使用更新的图像。

Until I saw your question, I did not have the latest versions and tried running Firebase Auth 9.0.2 on a Nexus 5X API 21 emulator. It failed with a message similar to what you reported. I then downloaded the latest image (rev 12) and am now able to run successfully.

在我看到您的问题之前,我没有最新版本,并尝试在Nexus 5X API 21仿真器上运行Firebase Auth 9.0.2。它失败的消息类似于您报告的消息。然后我下载了最新的图像(rev 12),现在我可以成功运行了。

#2


8  

best way for future problems like this is .

这样的未来问题的最好方法是。

open you emulator go to settings > apps > Google Play Services

打开模拟器转到设置>应用> Google Play服务

you will find witch version your AVD is using

你会发现你的AVD使用的女巫版本

Firebase Auth无法正常工作 - 模拟器上的“更新Google Play服务”消息(Android)

now that you know the number your AVD is using just use any

既然您知道AVD正在使用的号码,那就使用任何号码

version equal or bellow in your gradle

版本等于或低于你的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'

this work for me , i hope it helps !

这项工作对我来说,我希望它有所帮助!

#3


0  

I solved this problem by updating Google Play services. Initially at 8.0 and I updated it to 11.0.

我通过更新Google Play服务解决了这个问题。最初在8.0,我将其更新为11.0。

#4


-1  

Just go t manifest.xml and gradle build set minSDKversion to 15..i have solved my problem with this.

只需将manifest.xml和gradle构建集minSDKversion设置为15..i即可解决我的问题。