Android Question FirebaseUI issue

asubias

Member
Licensed User
Hi. I am trying to implement the FirebaseUI lib by DonManfred
https://www.b4x.com/android/forum/threads/firebase-ui-auth-a-new-dimension-in-authentication.87580/

I followed all the steps but when i call for StartActivity of SignInIntentBuilder i get the following error:
B4X:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.firebase/com.firebase.ui.auth.ui.idp.AuthMethodPickerActivity}: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class android.support.constraint.ConstraintLayout
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2795)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2873)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1602)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6543)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class android.support.constraint.ConstraintLayout
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.constraint.ConstraintLayout
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.constraint.ConstraintLayout" on path: DexPathList[[zip file "/data/app/com.example.firebase-GgaYkTIdH0DrtRmu==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.firebase-GgaYkTIdH0DrtRmu==/lib/arm64, /data/app/com.example.firebase-GgaYkTIdH0DrtRmu==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    at android.view.LayoutInflater.createView(LayoutInflater.java:606)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
    at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
    at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
    at com.firebase.ui.auth.ui.idp.AuthMethodPickerActivity.onCreate(AuthMethodPickerActivity.java:70)
    at android.app.Activity.performCreate(Activity.java:7023)
    at android.app.Activity.performCreate(Activity.java:7014)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2748)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2873)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1602)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6543)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

My imports section:
B4X:
#AdditionalJar: androidx.legacy:legacy-support-core-utils
#AdditionalJar: androidx.annotation:annotation
#AdditionalJar: androidx.core:core
#AdditionalJar: androidx.appcompat:appcompat
#AdditionalJar: androidx.legacy:legacy-support-v4
'lines above are for other parts of the app

#Extends: android.support.v7.app.AppCompatActivity
#AdditionalJar: com.android.support.constraint:constraint-layout
#AdditionalJar: com.android.support.constraint:constraint-layout-solver
#AdditionalJar: com.android.support:customtabs
#AdditionalJar: android.arch.lifecycle:extensions
#AdditionalJar: com.google.android.gms:play-services-auth
#AdditionalJar: com.google.firebase:firebase-auth
#AdditionalJar: firebase-ui-auth.aar
#AdditionalJar: firebase-ui-common.aar
#AdditionalJar: firebase-ui-database.aar
#AdditionalJar: firebase-ui-firestore.aar
#AdditionalJar: firebase-ui-storage.aar
#AdditionalRes: ..\res.FirebaseUI

I also tried with the new AndroidX dependencies as they told in the Github https://github.com/firebase/FirebaseUI-Android
B4X:
#AdditionalJar: android.arch.lifecycle:extensions
#AdditionalJar: androidx.browser:browser
#AdditionalJar: androidx.cardview:cardview
#AdditionalJar: androidx.constraintlayout:constraintlayout
#AdditionalJar: com.google.android.material:material

It seems like the ConstraintsLayout dependency are not compiling correctly...

Thank you in advance.

Best regards,
Alberto
 

DonManfred

Expert
Licensed User
Longtime User
Hi. I am trying to implement the FirebaseUI lib by DonManfred
the problem is that the library is 2 years old. I can´t help on this issue as i do not have a working FBUI Library as of now. I never got the newest github project working. It is now based on kotlin too.

You are using which b4A Version?
Did you try to jetifier the library?

I suggest to not use the library.

Instead use FirebaseAuth or firebaseAuthEx2 if you need to login by email and password.
 
Last edited:
Upvote 0

asubias

Member
Licensed User
Thank you for your fast reply!
You are using which b4A Version?
Did you try to jetifier the library?
I have the latest B4A version (9.5) and yes, I tried to jetify the library.

I suggest to not use the library.
Instead use FirebaseAuth or firebaseAuthEx2 if you need to login by email and password.
Okay. I have used the FirebaseAuth but I wish to have phone authentication and email so the FirebaseUI is an awesome project for this.
I will explore other options

Best regards,
Alberto
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
yes, the ui lib is nice. Really nice.

In 2017 (before migrating to androidX AND kotlin) it was working fine :-(

The newest release of the FirebaseUI Github project is using internally additional libraries. One of this additional libs is causing a problem now, I don´t know exactly it´s name but i had problems providing a correct (working) resourcefolder for the UI-Library as it now needs some more styles for this additional lib. There are styles missing somhow
 
Upvote 0
Top