Android Question Issue with Firebase auth

sktanmoy

Active Member
Licensed User
Hello,

I was trying to integrate Firebase Auth (Google Only) to my app. But facing issues.

Error Log:

B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
FirebaseAuth initialized
Error occurred on line: 27 (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:57)
    at com.rogun.macroflex.main._activity_create(main.java:389)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:735)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:360)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:260)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at com.rogun.macroflex.main.afterFirstLayout(main.java:104)
    at com.rogun.macroflex.main.access$000(main.java:17)
    at com.rogun.macroflex.main$WaitForLayout.run(main.java:82)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6186)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
** Activity (main) Resume **


Manifest:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
On line 27, there was **auth.Initialize("auth")**.

Can you guys help me to sort out the issue?

Thanks
 
Last edited:

DonManfred

Expert
Licensed User
I think not.

Find the installation instructions here: https://www.b4x.com/b4a.html

Watch the Video! 5 Minutes which describes all stepes clearly.

Start with a new blank folder for the SDK.

Make sure to have the newest Libs installed
https://www.b4x.com/android/forum/threads/updates-to-internal-libraries.59340/#post-596101
and
https://www.b4x.com/android/forum/threads/updates-to-internal-libraries.59340/#post-591400

Note that they must reside in the internal library folder).
 
Top