Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest Firestore Quickstart encounters NoClassDefFoundError: CredentialsOptions$Builder #1647

Open
argzdev opened this issue Aug 5, 2024 · 2 comments

Comments

@argzdev
Copy link

argzdev commented Aug 5, 2024

Step 1: Describe your environment

  • Android device: Android Emualtor
  • Android OS version: Android 11
  • Google Play Services version: 21.2.0
  • Firebase/Play Services SDK version: 33.1.2

Step 2: Describe the problem:

Steps to reproduce:

  1. Download Quickstart
  2. Run Firestore

Observed Results:

  • What happened? This could be a description, logcat output, etc.
2024-08-05 19:12:58.712  7297-7297  AndroidRuntime          com...gle.firebase.example.fireeats  E  FATAL EXCEPTION: main
                                                                                                    Process: com.google.firebase.example.fireeats, PID: 7297
                                                                                                    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/auth/api/credentials/CredentialsOptions$Builder;
                                                                                                    	at com.firebase.ui.auth.util.GoogleApiUtils.getCredentialsClient(GoogleApiUtils.java:29)
                                                                                                    	at com.firebase.ui.auth.viewmodel.AuthViewModelBase.onCreate(AuthViewModelBase.java:30)
                                                                                                    	at com.firebase.ui.auth.viewmodel.ViewModelBase.init(ViewModelBase.java:24)
                                                                                                    	at com.firebase.ui.auth.KickoffActivity.onCreate(KickoffActivity.java:38)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8000)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:7984)
                                                                                                    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
                                                                                                    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422)
                                                                                                    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
                                                                                                    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                    	at android.os.Looper.loop(Looper.java:223)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:7656)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
                                                                                                    Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.auth.api.credentials.CredentialsOptions$Builder" on path: DexPathList[[zip file "/data/app/~~jxILtii72sMxj9gULZghyg==/com.google.firebase.example.fireeats-HCrLOYixLfszxtdVOEXyiw==/base.apk"],nativeLibraryDirectories=[/data/app/~~jxILtii72sMxj9gULZghyg==/com.google.firebase.example.fireeats-HCrLOYixLfszxtdVOEXyiw==/lib/x86, /system/lib, /system_ext/lib]]
                                                                                                    	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
                                                                                                    	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
                                                                                                    	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                                                                                                    	at com.firebase.ui.auth.util.GoogleApiUtils.getCredentialsClient(GoogleApiUtils.java:29) 
                                                                                                    	at com.firebase.ui.auth.viewmodel.AuthViewModelBase.onCreate(AuthViewModelBase.java:30) 
                                                                                                    	at com.firebase.ui.auth.viewmodel.ViewModelBase.init(ViewModelBase.java:24) 
                                                                                                    	at com.firebase.ui.auth.KickoffActivity.onCreate(KickoffActivity.java:38) 
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8000) 
                                                                                                    	at android.app.Activity.performCreate(Activity.java:7984) 
                                                                                                    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309) 
                                                                                                    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422) 
                                                                                                    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601) 
                                                                                                    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) 
                                                                                                    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
                                                                                                    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) 
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                                                    	at android.os.Looper.loop(Looper.java:223) 
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:7656) 
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 

Expected Results:

  • What did you expect to happen?
  • Should work normally.

Relevant Information:

According to this Stack Overflow thread,com.google.android.gms:play-services-auth of version 21.2.0 no longer uses Credentials API. Mitigation for now is downgrading to version 20.7.0.

@thatfiredev
Copy link
Member

@argzdev Thanks for reporting this. The Firestore quickstart uses the Firebase UI library, which has a bug that I haven't been able to prioritize 😓 : firebase/FirebaseUI-Android#2158

Mitigation for now is downgrading to version 20.7.0.

Would you like to send a PR pinning the version in this quickstart as a temporary fix for now? We can remove the pinned verison once that bug is fixed.

@argzdev
Copy link
Author

argzdev commented Aug 21, 2024

Hey @thatfiredev, totally missed your reply! @lehcar09 will do the honors for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants