Android Question Latest SDK update breaks FirebaseAuth Library

johndb

Active Member
Licensed User
I did my regular SDK update which included several Firebase updates.
Firebase authentication which worked perfectly fine prior to the update is now broken.

Before someone asks ... B4A 8.0 Target SDK 26, previous fully updated with B4A 8.0 update recommendations. Note: My app worked well before the SDK update.

The following error occurs during the initialization of a FirebaseAuth instance.

B4X:
*** Service (starter) Create ***
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.firebase.auth.FirebaseAuth.addAuthStateListener(com.google.firebase.auth.FirebaseAuth$AuthStateListener)' on a null object reference
    at anywheresoftware.b4a.objects.FirebaseAuthWrapper.Initialize(FirebaseAuthWrapper.java:57)
    at com.scsoftwarestudios.aicalc.antennas.starter._service_create(starter.java:459)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
    at com.scsoftwarestudios.aicalc.antennas.starter.onCreate(starter.java:56)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3339)
    at android.app.ActivityThread.-wrap4(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6494)
    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)
** Service (starter) Start **
Any help would be appreciated.
 
Last edited:

Erel

Administrator
Staff member
Licensed User
The issue with Firebase Messaging is fixed in v1.21: https://www.b4x.com/android/forum/threads/updates-to-internal-libraries.59340/#post-591400

The issue with Firebase Auth looks like a bug in the latest version of Firebase Auth SDK (firebase-auth 16.0.1). For now you should use the previous version.

Open B4A Sdk Manager folder and find: extras\b4a_remote\installed-components.txt
Open this file, search for com.google.firebase\:firebase-auth=
Change the version to 15.1.0
 
Last edited:
Top