Android Question Issue with Firebase auth

Discussion in 'Android Questions' started by sktanmoy, Aug 4, 2018.

  1. sktanmoy

    sktanmoy Active Member Licensed User

    Hello,

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

    Error Log:

    Code:
    *** 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:
    Code:
    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: Aug 4, 2018
  2. KMatle

    KMatle Expert Licensed User

    Did you update everything? (lib & sdk manager)
     
  3. sktanmoy

    sktanmoy Active Member Licensed User

    I set up a new machine yesterday. So everything should be updated, I think.
     
  4. DonManfred

    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).
     
  5. sktanmoy

    sktanmoy Active Member Licensed User

    Internal Library updates fixed that issue, thanks.
     
    Last edited: Aug 4, 2018
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice