Android Firebase DynamiteModule:未能加载模块描述符

时间:2021-12-13 20:55:54

Since upgrading to the newest version of Firebase (9.0.0), I can't get rid of the following two errors when authenticating a user through signInWithEmailAndPassword(). Does anyone have an idea what's going on?

由于升级到最新版本的Firebase(9.0.0),所以在通过signInWithEmailAndPassword()对用户进行身份验证时,我无法避免以下两个错误。有人知道发生了什么事吗?

    05-19 18:09:49.245 23550-23589/[PACKAGE] E/DynamiteModule: Failed to load 
    module descriptor class: Didn't find class 
    "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor" 
on path: DexPathList[[zip file 
"/data/app/[PACKAGE]-3/base.apk"],nativeLibraryDirectories=
[/data/app/[PACKAGE]-3/lib/x86, /vendor/lib, /system/lib]]

And

    05-19 18:09:49.252 23550-23550/[PACKAGE] E/FirebaseApp: Firebase API 
initialization failure.java.lang.reflect.InvocationTargetException

      at java.lang.reflect.Method.invoke(Native Method)
      at com.google.firebase.FirebaseApp.zza(Unknown Source)
      at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
      at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
      at com.google.firebase.FirebaseApp.zzbu(Unknown Source)
      at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
      at android.content.ContentProvider.attachInfo(ContentProvider.java:1748)
      at android.content.ContentProvider.attachInfo(ContentProvider.java:1723)
      at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)

(...)    
Caused by: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.firebase.iid.zzg' appears in /data/data/[PACKAGE]/files/instant-run/dex/slice-com.google.firebase-firebase-iid-9.0.0_95503dc60ed409569d1585da411de93e6c633bf7-classes.dex)
      at com.google.firebase.iid.zzg.zzeC(Unknown Source)
      at com.google.firebase.iid.zzg.<init>(Unknown Source)
      at com.google.firebase.iid.zzg.<init>(Unknown Source)
      at com.google.firebase.iid.zzd.zzb(Unknown Source)
      at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
      at java.lang.reflect.Method.invoke(Native Method) 
      at com.google.firebase.FirebaseApp.zza(Unknown Source) 
      at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
      at com.google.firebase.FirebaseApp.initializeApp(Unknown Source) 
      at com.google.firebase.FirebaseApp.zzbu(Unknown Source)  
      at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source) 
      at android.content.ContentProvider.attachInfo(ContentProvider.java:1748) 
      at android.content.ContentProvider.attachInfo(ContentProvider.java:1723) 
      at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source) 

(...)

13 个解决方案

#1


11  

Can you check your Google Play Services version?

你能检查你的谷歌播放服务版本吗?

From Firebase oficial website:

从重火力点oficial网站:

Prerequisites

先决条件

  • An Android device running Google Play services 9.0.0 or later
  • 运行谷歌的Android设备运行服务9.0.0或更高。
  • The Google Play services SDK from the Android SDK Manager
  • 谷歌运行来自Android SDK管理器的服务SDK
  • Android Studio 1.5 or higher
  • Android Studio 1.5或更高版本。
  • An Android Studio project and its package name.
  • 一个Android Studio项目及其包名。

#2


26  

I had the same problem and I found a mistake done by me in my Firebase console.

我遇到了同样的问题,我发现我在我的Firebase控制台犯了一个错误。

One of the reason for this problem could be, your Sign In Method inside Firebase > Auth Dashboard might be disabled.

这个问题的一个原因可能是,您在Firebase > Auth仪表板中的登录方法可能被禁用。

I just enabled it and it started working.

我刚刚启用它,它就开始工作了。

#3


3  

Very sad that Firebase initialization errors are so not straightforward, so developers need to guess what went wrong. In my case I imported only:

非常遗憾的是,由于Firebase的初始化错误并不简单,所以开发人员需要猜测到底哪里出错了。就我而言,我只进口:

compile 'com.google.firebase:firebase-auth:10.2.0'

and forgot to import also core:

而忘记导入也核心:

compile 'com.google.firebase:firebase-core:10.2.0'

Maybe it will help someone, good luck!

也许它会帮助某人,祝你好运!

#4


1  

I found the issue. The issue was the first prerequisite Guilherme mentioned, but not the boldfaced part.. Although your dependencies also need to explicitly state 9.+ of the play services part, the devices itself also needs to have 9.+ installed. Debugging on my phone works fine and updating the image of my emulator solves the issue there as well.

我发现这个问题。这个问题是Guilherme提到的第一个先决条件,而不是粗体部分。尽管您的依赖项也需要显式地状态9。在play服务部分,设备本身也需要有9个。+安装。在我的手机上进行调试可以正常工作,更新模拟器的映像也可以解决这个问题。

#5


1  

Disabling Instant Run worked for me. Sounds ridiculous, I know. I tried cleaning the project. I tried uninstalling/reinstalling the app. The thing that finally did the trick was disabling Instant Run. sigh

禁用即时运行对我有用。我知道听起来很荒谬。我试着清理这个项目。我试着卸载/重新安装这个应用程序。最后成功的方法是禁用即时运行。叹息

#6


1  

I logged out and then logged in and it solved this problem for me.

我登出然后登入,它帮我解决了这个问题。

Probably from some kind of synchronization the FB stuff have not implemented.

可能是由于某种同步,FB的东西没有实现。

If this problem consist I will try to intercept it. But reallly, this is a bug in Firebase system. And It is a bug that is caused by more than one use case, which is another issue on its own.

如果这个问题存在,我将设法拦截它。但实际上,这是一个消防系统的错误。这是一个由多个用例引起的错误,这是另一个问题。

#7


0  

You can check out while adding google sign in option Before we use

在我们使用之前,您可以在添加谷歌登录选项时签出

GoogleSignInOptions gso = new GoogleSignInOptions
                    .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                    .requestEmail()
                    .build();

add one line as show in the following code

添加一行,如下面的代码所示

GoogleSignInOptions gso = new GoogleSignInOptions
                .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                .requestIdToken(getString(R.string.default_web_client_id))
                .requestEmail()
                .build();

after adding this if you get the error like

在添加这个之后,如果你得到了类似的错误

An internal error has occured. [ Invalid Idp Response: id_token audience mismatch. ]

then Click here to get solution this works for me.

然后点击这里获得解决方案这对我来说是可行的。

#8


0  

If you just want to use the Firebase authentication and you got here because of the error:

如果您只是想使用Firebase身份验证,但是由于错误而到达这里:

Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor"

没有找到类“com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor”

Go to https://console.firebase.google.com/project/[your project]/authentication/providers and enable the authentication providers you support.

转到https://console.firebase.google.com/project/[您的项目]/认证/提供者,并启用您所支持的认证提供者。

#9


0  

I had similar issue with signup the user but finally found a working solution.

我在注册用户时遇到过类似的问题,但最终找到了一个有效的解决方案。

Uninstall the HAXM and reinstall it solves my issue and it successfully signup's the user to firebase auth :)

卸载HAXM并重新安装它解决了我的问题,它成功地将用户注册为firebase auth:)

#10


0  

This answer on another question made my app authenticate

这个问题的答案让我的应用程序验证了。

Alfonso Gomez Jordana Manas

阿方索·戈麦斯Jordana马纳斯基地

Hello Pierre,

你好,皮埃尔,

You have to manually whitelist your existing Google OAuth 2.0 client IDs in the Firebase console before using it with the new Auth APIs.

在使用新的Auth api之前,您必须在Firebase控制台中手动地对现有的谷歌OAuth 2.0客户机id进行白名单。

In order to do so, follow these steps:

为了做到这一点,请遵循以下步骤:

  • Go to the Credentials section in the Google API Console.
  • 转到谷歌API控制台的凭据部分。
  • Select from the top right corner the project where you had previously configured Google Sign-In.
  • 从右上角选择之前配置谷歌登录的项目。
  • Go to the OAuth 2.0 client IDs section If you are using Google Sign-In on Android or iOS applications: Take note of the Client ID string corresponding to all the entries registered for your applications.
  • 如果您正在Android或iOS应用程序上使用谷歌登录,请访问OAuth 2.0客户端ID部分:注意与应用程序注册的所有条目对应的客户端ID字符串。
  • Input these Client IDs into your Firebase project’s configuration:
  • 将这些客户端id输入到您的Firebase项目的配置中:
  • Go to the Firebase console at https://console.firebase.google.com
  • 到Firebase控制台,https://console.firebase.google.com
  • Open the Auth section

    打开认证部分

    Under Sign-In methods, open the Google configuration, and add all your client IDs to the whitelist of client IDs from external projects. If you are using Google Sign-In on a web application: Click to open your web client ID and take note of both the client ID and secret. Input this Client ID into your Firebase project’s configuration: Go to the Firebase console at https://console.firebase.google.com Open the Auth section Under Sign-In methods, open the Google configuration, and add the values under the Web SDK configuration section.

    在登录方法下,打开谷歌配置,并将所有客户端id添加到来自外部项目的客户端id的白名单中。如果您正在web应用程序上使用谷歌登录:单击以打开web客户端ID,并注意客户端ID和secret。将此客户端ID输入到您的Firebase项目的配置中:转到https://console.firebase.google.com的Firebase控制台,在登录方法下打开Auth部分,打开谷歌配置,并在Web SDK配置部分中添加值。

Let me know if this resolves your issue.

如果这能解决你的问题,请告诉我。

#11


0  

if you do everything but you got nothing try to update your ARM EABI.

如果你什么都做但什么都没做试着更新你的手臂EABI。

Google APIs ARM EABI v7a System Image

谷歌api ARM EABI v7a系统图像。

If your emulator has not new goggle updates you will get always auth error.

如果您的仿真器没有新的goggle更新,您将总是得到auth错误。

Do everything suggested in this post then update ARM EABI image. This solved my problem.

尽一切建议在这篇文章,然后更新手臂EABI图像。这解决了我的问题。

#12


0  

It may also happen when you don't have the SHA1 fingerprints registered in Firebase and in Google API. There in both of them must register two fingerprints: from the debug keystore and from the production keystore (generated when you create the project's apk for the first time when you enter some password keys on Android Studio).

当您在Firebase和谷歌API中没有注册SHA1指纹时,也可能会发生这种情况。在两者中都必须注册两个指纹:从调试密钥存储库和生产密钥存储库(当您在Android Studio上首次创建项目的apk时生成)。

Here shows how to get the SHA1 from there.

这里展示了如何从那里获取SHA1。

or run this command on C:\Users\<user name>\.android directory.

或者运行这个命令C:\Users\ <用户名> \。android目录。

keytool -list -v -keystore debug.keystore

#13


0  

Sharing my experience: I faced the same issue, I googled everywhere but couldn't find the exact answer, even if I was doing everything as documented by Google Android documentation. Suddenly after a day, my app was working fine and at that same moment I got the email from google stating "Google APIs Explorer connected to your Google Account". And it looks to me that google takes time to grant us access, just wait for this email, maybe this issue is not related to bad code.

分享我的经验:我遇到了同样的问题,我在任何地方搜索,但没有找到确切的答案,即使我做的一切都是用谷歌Android文档记录的。一天之后,我的应用程序突然运行得很好,同时我收到了来自谷歌的邮件,上面写着“谷歌api Explorer连接到你的谷歌账户”。在我看来谷歌授权给我们访问,只是等待这封邮件,也许这个问题与坏代码无关。

#1


11  

Can you check your Google Play Services version?

你能检查你的谷歌播放服务版本吗?

From Firebase oficial website:

从重火力点oficial网站:

Prerequisites

先决条件

  • An Android device running Google Play services 9.0.0 or later
  • 运行谷歌的Android设备运行服务9.0.0或更高。
  • The Google Play services SDK from the Android SDK Manager
  • 谷歌运行来自Android SDK管理器的服务SDK
  • Android Studio 1.5 or higher
  • Android Studio 1.5或更高版本。
  • An Android Studio project and its package name.
  • 一个Android Studio项目及其包名。

#2


26  

I had the same problem and I found a mistake done by me in my Firebase console.

我遇到了同样的问题,我发现我在我的Firebase控制台犯了一个错误。

One of the reason for this problem could be, your Sign In Method inside Firebase > Auth Dashboard might be disabled.

这个问题的一个原因可能是,您在Firebase > Auth仪表板中的登录方法可能被禁用。

I just enabled it and it started working.

我刚刚启用它,它就开始工作了。

#3


3  

Very sad that Firebase initialization errors are so not straightforward, so developers need to guess what went wrong. In my case I imported only:

非常遗憾的是,由于Firebase的初始化错误并不简单,所以开发人员需要猜测到底哪里出错了。就我而言,我只进口:

compile 'com.google.firebase:firebase-auth:10.2.0'

and forgot to import also core:

而忘记导入也核心:

compile 'com.google.firebase:firebase-core:10.2.0'

Maybe it will help someone, good luck!

也许它会帮助某人,祝你好运!

#4


1  

I found the issue. The issue was the first prerequisite Guilherme mentioned, but not the boldfaced part.. Although your dependencies also need to explicitly state 9.+ of the play services part, the devices itself also needs to have 9.+ installed. Debugging on my phone works fine and updating the image of my emulator solves the issue there as well.

我发现这个问题。这个问题是Guilherme提到的第一个先决条件,而不是粗体部分。尽管您的依赖项也需要显式地状态9。在play服务部分,设备本身也需要有9个。+安装。在我的手机上进行调试可以正常工作,更新模拟器的映像也可以解决这个问题。

#5


1  

Disabling Instant Run worked for me. Sounds ridiculous, I know. I tried cleaning the project. I tried uninstalling/reinstalling the app. The thing that finally did the trick was disabling Instant Run. sigh

禁用即时运行对我有用。我知道听起来很荒谬。我试着清理这个项目。我试着卸载/重新安装这个应用程序。最后成功的方法是禁用即时运行。叹息

#6


1  

I logged out and then logged in and it solved this problem for me.

我登出然后登入,它帮我解决了这个问题。

Probably from some kind of synchronization the FB stuff have not implemented.

可能是由于某种同步,FB的东西没有实现。

If this problem consist I will try to intercept it. But reallly, this is a bug in Firebase system. And It is a bug that is caused by more than one use case, which is another issue on its own.

如果这个问题存在,我将设法拦截它。但实际上,这是一个消防系统的错误。这是一个由多个用例引起的错误,这是另一个问题。

#7


0  

You can check out while adding google sign in option Before we use

在我们使用之前,您可以在添加谷歌登录选项时签出

GoogleSignInOptions gso = new GoogleSignInOptions
                    .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                    .requestEmail()
                    .build();

add one line as show in the following code

添加一行,如下面的代码所示

GoogleSignInOptions gso = new GoogleSignInOptions
                .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                .requestIdToken(getString(R.string.default_web_client_id))
                .requestEmail()
                .build();

after adding this if you get the error like

在添加这个之后,如果你得到了类似的错误

An internal error has occured. [ Invalid Idp Response: id_token audience mismatch. ]

then Click here to get solution this works for me.

然后点击这里获得解决方案这对我来说是可行的。

#8


0  

If you just want to use the Firebase authentication and you got here because of the error:

如果您只是想使用Firebase身份验证,但是由于错误而到达这里:

Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor"

没有找到类“com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor”

Go to https://console.firebase.google.com/project/[your project]/authentication/providers and enable the authentication providers you support.

转到https://console.firebase.google.com/project/[您的项目]/认证/提供者,并启用您所支持的认证提供者。

#9


0  

I had similar issue with signup the user but finally found a working solution.

我在注册用户时遇到过类似的问题,但最终找到了一个有效的解决方案。

Uninstall the HAXM and reinstall it solves my issue and it successfully signup's the user to firebase auth :)

卸载HAXM并重新安装它解决了我的问题,它成功地将用户注册为firebase auth:)

#10


0  

This answer on another question made my app authenticate

这个问题的答案让我的应用程序验证了。

Alfonso Gomez Jordana Manas

阿方索·戈麦斯Jordana马纳斯基地

Hello Pierre,

你好,皮埃尔,

You have to manually whitelist your existing Google OAuth 2.0 client IDs in the Firebase console before using it with the new Auth APIs.

在使用新的Auth api之前,您必须在Firebase控制台中手动地对现有的谷歌OAuth 2.0客户机id进行白名单。

In order to do so, follow these steps:

为了做到这一点,请遵循以下步骤:

  • Go to the Credentials section in the Google API Console.
  • 转到谷歌API控制台的凭据部分。
  • Select from the top right corner the project where you had previously configured Google Sign-In.
  • 从右上角选择之前配置谷歌登录的项目。
  • Go to the OAuth 2.0 client IDs section If you are using Google Sign-In on Android or iOS applications: Take note of the Client ID string corresponding to all the entries registered for your applications.
  • 如果您正在Android或iOS应用程序上使用谷歌登录,请访问OAuth 2.0客户端ID部分:注意与应用程序注册的所有条目对应的客户端ID字符串。
  • Input these Client IDs into your Firebase project’s configuration:
  • 将这些客户端id输入到您的Firebase项目的配置中:
  • Go to the Firebase console at https://console.firebase.google.com
  • 到Firebase控制台,https://console.firebase.google.com
  • Open the Auth section

    打开认证部分

    Under Sign-In methods, open the Google configuration, and add all your client IDs to the whitelist of client IDs from external projects. If you are using Google Sign-In on a web application: Click to open your web client ID and take note of both the client ID and secret. Input this Client ID into your Firebase project’s configuration: Go to the Firebase console at https://console.firebase.google.com Open the Auth section Under Sign-In methods, open the Google configuration, and add the values under the Web SDK configuration section.

    在登录方法下,打开谷歌配置,并将所有客户端id添加到来自外部项目的客户端id的白名单中。如果您正在web应用程序上使用谷歌登录:单击以打开web客户端ID,并注意客户端ID和secret。将此客户端ID输入到您的Firebase项目的配置中:转到https://console.firebase.google.com的Firebase控制台,在登录方法下打开Auth部分,打开谷歌配置,并在Web SDK配置部分中添加值。

Let me know if this resolves your issue.

如果这能解决你的问题,请告诉我。

#11


0  

if you do everything but you got nothing try to update your ARM EABI.

如果你什么都做但什么都没做试着更新你的手臂EABI。

Google APIs ARM EABI v7a System Image

谷歌api ARM EABI v7a系统图像。

If your emulator has not new goggle updates you will get always auth error.

如果您的仿真器没有新的goggle更新,您将总是得到auth错误。

Do everything suggested in this post then update ARM EABI image. This solved my problem.

尽一切建议在这篇文章,然后更新手臂EABI图像。这解决了我的问题。

#12


0  

It may also happen when you don't have the SHA1 fingerprints registered in Firebase and in Google API. There in both of them must register two fingerprints: from the debug keystore and from the production keystore (generated when you create the project's apk for the first time when you enter some password keys on Android Studio).

当您在Firebase和谷歌API中没有注册SHA1指纹时,也可能会发生这种情况。在两者中都必须注册两个指纹:从调试密钥存储库和生产密钥存储库(当您在Android Studio上首次创建项目的apk时生成)。

Here shows how to get the SHA1 from there.

这里展示了如何从那里获取SHA1。

or run this command on C:\Users\<user name>\.android directory.

或者运行这个命令C:\Users\ <用户名> \。android目录。

keytool -list -v -keystore debug.keystore

#13


0  

Sharing my experience: I faced the same issue, I googled everywhere but couldn't find the exact answer, even if I was doing everything as documented by Google Android documentation. Suddenly after a day, my app was working fine and at that same moment I got the email from google stating "Google APIs Explorer connected to your Google Account". And it looks to me that google takes time to grant us access, just wait for this email, maybe this issue is not related to bad code.

分享我的经验:我遇到了同样的问题,我在任何地方搜索,但没有找到确切的答案,即使我做的一切都是用谷歌Android文档记录的。一天之后,我的应用程序突然运行得很好,同时我收到了来自谷歌的邮件,上面写着“谷歌api Explorer连接到你的谷歌账户”。在我看来谷歌授权给我们访问,只是等待这封邮件,也许这个问题与坏代码无关。