Android Question Problem with FirebaseAuth Library - Had it working before but not now

chris ash

Member
Licensed User
Longtime User
Hi guys

So the issue I seem to be having is very similar to this issue from previous...

https://www.b4x.com/android/forum/threads/latest-sdk-update-breaks-firebaseauth-library.93446/

Before someone asks ... B4A 10.0 Target SDK 28, fully updated in SDK manager

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

B4X:
*** Service (starter) Create ***
starter_service_create (java line: 5463)
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:73)
    at com.CasinoCrazyClub.starter._service_create(starter.java:5463)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
    at com.CasinoCrazyClub.starter.onCreate(starter.java:56)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:4387)
    at android.app.ActivityThread.access$1900(ActivityThread.java:273)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:237)
    at android.app.ActivityThread.main(ActivityThread.java:8125)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

The previous issue above seemed to imply an issue with an update. Could this be a similar issue? Or has anyone else experienced this issue and found a cure.

Another minor issue which may or may not be linked? It absolutely does not like me using the following in the manifest...

B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)

However if I use the older method example below it works fine?

CreateResourceFromFile("google-services", "google-services.json")
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.INTERNET)

I just seem to be having issues with the whole Firebase thing in general, and looking at the forum I dont seem to be the only one but I have no as yet found a solution to the auth issue?

Any questions fire away

Cheers
CAsh
 
Top