Android Question FireBaseAuth v1.05 NullPointerException on Initialize

scsjc

Well-Known Member
Licensed User
Longtime User
Hi, i update a internal library -> FirebaseAuth v1.05
and update the -> firebase-auth resource (currently v16.0.2)

get this error:

B4X:
Copying updated assets files (2)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 25 (Main)
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:56)
    at com.oficinadirecta.main._activity_create(main.java:384)
    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 com.oficinadirecta.main.afterFirstLayout(main.java:104)
    at com.oficinadirecta.main.access$000(main.java:17)
    at com.oficinadirecta.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:790)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    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)
** Activity (main) Resume **
 

scsjc

Well-Known Member
Licensed User
Longtime User
Hi, i update a internal library -> FirebaseAuth v1.05
and update the -> firebase-auth resource (currently v16.0.2)
[/CODE]



SOLVED... changing on manifest editor, the old code for firebase to the new macros:

B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…