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

Multiverse app

Active Member
Licensed User
After upgrading to AndroidX, all of our apps using realtimedatabase have been broken:


B4X:
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:

B4X:
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"))
 
Top