1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question java.lang.NullPointerException: Firebase Database component is not present.

Discussion in 'Android Questions' started by Multiverse app, Aug 2, 2019.

  1. Multiverse app

    Multiverse app Active Member Licensed User

    After upgrading to AndroidX, all of our apps using realtimedatabase have been broken:


    Code:
    java.lang.NullPointerException: Firebase Database component is not present.
        at com.google.android.gms.common.internal.Preconditions.checkNotNull(Unknown Source:
    11)
        at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database@@
    17.0.0:120)
        at com.google.firebase.database.FirebaseDatabase.getInstance(com.google.firebase:firebase-database@@
    17.0.0:60)
        at de.donmanfred.FirebaseDatabaseWrapper.Initialize(FirebaseDatabaseWrapper.java:
    25)
        at com.multiverse.memegenerator.indian.starter._service_create(starter.java:
    449)
        at java.lang.reflect.Method.invoke(Native Method)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    196)
        at anywheresoftware.b4a.BA.raiseEvent(BA.java:
    176)
        at com.multiverse.memegenerator.indian.starter.onCreate(starter.java:
    56)
        at android.app.ActivityThread.handleCreateService(ActivityThread.java:
    3734)
        at android.app.ActivityThread.access$
    1400(ActivityThread.java:235)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
    1784)
        at android.os.Handler.dispatchMessage(Handler.java:
    106)
        at android.os.Looper.loop(Looper.java:
    214)
        at android.app.ActivityThread.main(ActivityThread.java:
    6990)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:
    493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
    1445)
    I added the following to manifest as said here:

    Code:
    AddApplicationText(
    <
    service android:name="com.google.firebase.components.ComponentDiscoveryService" >
    <meta-data
        android:name=
    "com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar"
        android:value=
    "com.google.firebase.components.ComponentRegistrar" />
    <meta-data
        android:name=
    "com.google.firebase.components:com.google.firebase.iid.Registrar"
        android:value=
    "com.google.firebase.components.ComponentRegistrar" />
    <meta-data
        android:name=
    "com.google.firebase.components:com.google.firebase.auth.FirebaseAuthRegistrar"
        android:value=
    "com.google.firebase.components.ComponentRegistrar" />
    <meta-data
        android:name=
    "com.google.firebase.components:com.google.firebase.database.DatabaseRegistrar"
        android:value=
    "com.google.firebase.components.ComponentRegistrar"/>
    </
    service>
    )

    Still, the error persists. (Realtimedb.Initialize("Realtimedb"))
     
  2. DonManfred

    DonManfred Expert Licensed User

    Your artifacts are not uptodate. Newest is 18.0.1


    Don´t know if this is the issue. I´ll check my RTDB-Example and see if this is working for me.
     
    MarcoRome likes this.
  3. Multiverse app

    Multiverse app Active Member Licensed User

    upload_2019-8-2_21-20-28.png
    Updated everything.
    Still, same issue
     
  4. DonManfred

    DonManfred Expert Licensed User

    it is working
    hmmm.. It is working here

    you manifest looks correct.
     
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