So i'm getting a RuntimeException
Here are the errors
Fatal Exception: java.lang.RuntimeException: Uncaught exception in Firebase Database runloop (19.4.0). If you are not already on the latest version of the Firebase SDKs, try updating your dependencies. Should this problem persist, please file a report at https://github.com/firebase/firebase-android-sdk
at com.google.firebase.database.android.AndroidPlatform$1$1.run(AndroidPlatform.java:96)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by java.lang.RuntimeException: java.lang.AssertionError: hardAssert failed:
at com.google.firebase.database.core.persistence.DefaultPersistenceManager.runInTransaction(DefaultPersistenceManager.java:244)
at com.google.firebase.database.core.SyncTree.removeEventRegistration(SyncTree.java:586)
at com.google.firebase.database.core.SyncTree.removeAllEventRegistrations(SyncTree.java:579)
at com.google.firebase.database.core.SyncTree$ListenContainer.onListenComplete(SyncTree.java:143)
at com.google.firebase.database.core.Repo$4$1.onRequestResult(Repo.java:191)
at com.google.firebase.database.connection.PersistentConnectionImpl.onListenRevoked(PersistentConnectionImpl.java:827)
at com.google.firebase.database.connection.PersistentConnectionImpl.onDataPush(PersistentConnectionImpl.java:808)
at com.google.firebase.database.connection.PersistentConnectionImpl.onDataMessage(PersistentConnectionImpl.java:415)
at com.google.firebase.database.connection.Connection.onDataMessage(Connection.java:164)
at com.google.firebase.database.connection.Connection.onMessage(Connection.java:128)
at com.google.firebase.database.connection.WebsocketConnection.appendFrame(WebsocketConnection.java:257)
at com.google.firebase.database.connection.WebsocketConnection.handleIncomingFrame(WebsocketConnection.java:304)
at com.google.firebase.database.connection.WebsocketConnection.access$500(WebsocketConnection.java:34)
at com.google.firebase.database.connection.WebsocketConnection$WSClientTubesock$2.run(WebsocketConnection.java:86)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by java.lang.AssertionError: hardAssert failed:
at com.google.firebase.database.core.utilities.Utilities.hardAssert(Utilities.java:234)
at com.google.firebase.database.core.utilities.Utilities.hardAssert(Utilities.java:229)
at com.google.firebase.database.core.ZombieEventManager.unRecordEventRegistration(ZombieEventManager.java:94)
at com.google.firebase.database.core.ZombieEventManager.onZombied(ZombieEventManager.java:155)
at com.google.firebase.database.core.EventRegistration.zombify(EventRegistration.java:50)
at com.google.firebase.database.core.view.View.removeEventRegistration(View.java:153)
at com.google.firebase.database.core.SyncPoint.removeEventRegistration(SyncPoint.java:180)
at com.google.firebase.database.core.SyncTree$12.call(SyncTree.java:603)
at com.google.firebase.database.core.SyncTree$12.call(SyncTree.java:587)
at com.google.firebase.database.core.persistence.DefaultPersistenceManager.runInTransaction(DefaultPersistenceManager.java:239)
at com.google.firebase.database.core.SyncTree.removeEventRegistration(SyncTree.java:586)
at com.google.firebase.database.core.SyncTree.removeAllEventRegistrations(SyncTree.java:579)
at com.google.firebase.database.core.SyncTree$ListenContainer.onListenComplete(SyncTree.java:143)
at com.google.firebase.database.core.Repo$4$1.onRequestResult(Repo.java:191)
at com.google.firebase.database.connection.PersistentConnectionImpl.onListenRevoked(PersistentConnectionImpl.java:827)
at com.google.firebase.database.connection.PersistentConnectionImpl.onDataPush(PersistentConnectionImpl.java:808)
at com.google.firebase.database.connection.PersistentConnectionImpl.onDataMessage(PersistentConnectionImpl.java:415)
at com.google.firebase.database.connection.Connection.onDataMessage(Connection.java:164)
at com.google.firebase.database.connection.Connection.onMessage(Connection.java:128)
at com.google.firebase.database.connection.WebsocketConnection.appendFrame(WebsocketConnection.java:257)
at com.google.firebase.database.connection.WebsocketConnection.handleIncomingFrame(WebsocketConnection.java:304)
at com.google.firebase.database.connection.WebsocketConnection.access$500(WebsocketConnection.java:34)
at com.google.firebase.database.connection.WebsocketConnection$WSClientTubesock$2.run(WebsocketConnection.java:86)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
I already have all the dependencies up to date
can you fix the error please?
I found a few problems with this issue:
I'm also facing this issue, and it is irritating as it force closes app again and again.
One solution is we can disable offline capabilities of firebase but it will be bad when user is offline and has no access to network.
I'm also facing this issue, and it is irritating as it force closes app again and again.
One solution is we can disable offline capabilities of firebase but it will be bad when user is offline and has no access to network.
Hey i fixed it by downgrading the dependencies
I'm also facing this issue, and it is irritating as it force closes app again and again.
One solution is we can disable offline capabilities of firebase but it will be bad when user is offline and has no access to network.Hey i fixed it by downgrading the dependencies
Can you please share your all firebase dependencies versions?
I'm also facing this issue, and it is irritating as it force closes app again and again.
One solution is we can disable offline capabilities of firebase but it will be bad when user is offline and has no access to network.Hey i fixed it by downgrading the dependencies
Can you please share your all firebase dependencies versions?
Yeah sure here you go
implementation 'com.firebaseui:firebase-ui-database:4.3.2'
implementation 'com.google.firebase:firebase-database:19.3.0'
implementation 'com.google.firebase:firebase-auth:19.3.2'
implementation 'com.google.firebase:firebase-core:17.5.0'
implementation 'com.google.firebase:firebase-firestore:21.6.0'
implementation 'com.firebaseui:firebase-ui-firestore:6.2.0'
implementation 'com.google.firebase:firebase-analytics:17.5.0'
implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
implementation 'com.google.firebase:firebase-messaging:20.2.4'
implementation "com.google.firebase:firebase-database:19.3.0"
I'm also facing this issue, and it is irritating as it force closes app again and again.
One solution is we can disable offline capabilities of firebase but it will be bad when user is offline and has no access to network.Hey i fixed it by downgrading the dependencies
Can you please share your all firebase dependencies versions?
Yeah sure here you go
implementation 'com.firebaseui:firebase-ui-database:4.3.2' implementation 'com.google.firebase:firebase-database:19.3.0' implementation 'com.google.firebase:firebase-auth:19.3.2' implementation 'com.google.firebase:firebase-core:17.5.0' implementation 'com.google.firebase:firebase-firestore:21.6.0' implementation 'com.firebaseui:firebase-ui-firestore:6.2.0' implementation 'com.google.firebase:firebase-analytics:17.5.0' implementation 'com.google.firebase:firebase-crashlytics:17.2.1' implementation 'com.google.firebase:firebase-messaging:20.2.4'
Thank you! @yorondahacker
Hey I also have the same issue after updating the Android Firebase realtime database to 19.0.4
implementation 'com.google.firebase:firebase-database:19.4.0'
Here is the stack trace:
Fatal Exception: java.lang.RuntimeException: Uncaught exception in Firebase Database runloop (19.4.0). If you are not already on the latest version of the Firebase SDKs, try updating your dependencies. Should this problem persist, please file a report at https://github.com/firebase/firebase-android-sdk
at com.google.firebase.database.android.AndroidPlatform$1$1.run(AndroidPlatform.java:96)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7561)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
Caused by java.lang.RuntimeException: java.lang.AssertionError: hardAssert failed: If we're setting the query to inactive, we should already be tracking it!
at com.google.firebase.database.core.persistence.DefaultPersistenceManager.runInTransaction(DefaultPersistenceManager.java:244)
at com.google.firebase.database.core.SyncTree.removeEventRegistration(SyncTree.java:586)
at com.google.firebase.database.core.SyncTree.removeEventRegistration(SyncTree.java:569)
at com.google.firebase.database.core.Repo.removeEventCallback(Repo.java:536)
at com.google.firebase.database.Query$2.run(Query.java:220)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by java.lang.AssertionError: hardAssert failed: If we're setting the query to inactive, we should already be tracking it!
at com.google.firebase.database.core.utilities.Utilities.hardAssert(Utilities.java:234)
at com.google.firebase.database.core.persistence.TrackedQueryManager.setQueryActiveFlag(TrackedQueryManager.java:162)
at com.google.firebase.database.core.persistence.TrackedQueryManager.setQueryInactive(TrackedQueryManager.java:150)
at com.google.firebase.database.core.persistence.DefaultPersistenceManager.setQueryInactive(DefaultPersistenceManager.java:199)
at com.google.firebase.database.core.SyncTree$12.call(SyncTree.java:617)
at com.google.firebase.database.core.SyncTree$12.call(SyncTree.java:587)
at com.google.firebase.database.core.persistence.DefaultPersistenceManager.runInTransaction(DefaultPersistenceManager.java:239)
at com.google.firebase.database.core.SyncTree.removeEventRegistration(SyncTree.java:586)
at com.google.firebase.database.core.SyncTree.removeEventRegistration(SyncTree.java:569)
at com.google.firebase.database.core.Repo.removeEventCallback(Repo.java:536)
at com.google.firebase.database.Query$2.run(Query.java:220)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
implementation "com.google.firebase:firebase-database:19.3.0"
I'm also facing this issue, and it is irritating as it force closes app again and again.
One solution is we can disable offline capabilities of firebase but it will be bad when user is offline and has no access to network.Hey i fixed it by downgrading the dependencies
Can you please share your all firebase dependencies versions?
Yeah sure here you go
implementation 'com.firebaseui:firebase-ui-database:4.3.2' implementation 'com.google.firebase:firebase-database:19.3.0' implementation 'com.google.firebase:firebase-auth:19.3.2' implementation 'com.google.firebase:firebase-core:17.5.0' implementation 'com.google.firebase:firebase-firestore:21.6.0' implementation 'com.firebaseui:firebase-ui-firestore:6.2.0' implementation 'com.google.firebase:firebase-analytics:17.5.0' implementation 'com.google.firebase:firebase-crashlytics:17.2.1' implementation 'com.google.firebase:firebase-messaging:20.2.4'Thank you! @yorondahacker
Thanks @sondevelopervn, I didn't know how to fix this but going back to 19.0.3 this error didn't appear anymore!
Hello everyone,
please try to replace
_implementation "com.google.firebase:firebase-database:19.3.0"_
with
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:25.12.0')
// Declare the dependency for the Realtime Database library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-database-ktx'
for reference you can check the doc
https://firebase.google.com/docs/database/android/start
I hope it will fix your problem
Hi @yorondahacker can you please take a look at #2017 to see if what's suggested there helps you with this issue?
Version 19.5.0 also has this problem!
I tried to use Firebase BoM to check if there is any conflict in versions.
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:25.12.0')
But still, it gives the same error:
java.lang.RuntimeException: Uncaught exception in Firebase Database runloop (19.5.0). If you are not already on the latest version of the Firebase SDKs, try updating your dependencies. Should this problem persist, please file a report at https://github.com/firebase/firebase-android-sdk
at com.google.firebase.database.t.h$a$a.run(AndroidPlatform.java:96)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7476)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:939)
Caused by: java.lang.RuntimeException: java.lang.AssertionError: hardAssert failed: If we're setting the query to inactive, we should already be tracking it!
at com.google.firebase.database.w.h0.b.j(DefaultPersistenceManager.java:244)
at com.google.firebase.database.w.w.R(SyncTree.java:586)
at com.google.firebase.database.w.w.Q(SyncTree.java:569)
at com.google.firebase.database.w.o.P(Repo.java:536)
at com.google.firebase.database.o$b.run(Query.java:220)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.lang.AssertionError: hardAssert failed: If we're setting the query to inactive, we should already be tracking it!
at com.google.firebase.database.w.i0.m.g(Utilities.java:234)
at com.google.firebase.database.w.h0.i.v(TrackedQueryManager.java:162)
at com.google.firebase.database.w.h0.i.x(TrackedQueryManager.java:150)
at com.google.firebase.database.w.h0.b.h(DefaultPersistenceManager.java:199)
at com.google.firebase.database.w.w$c.a(SyncTree.java:617)
at com.google.firebase.database.w.w$c.call(SyncTree.java:587)
at com.google.firebase.database.w.h0.b.j(DefaultPersistenceManager.java:239)
at com.google.firebase.database.w.w.R(SyncTree.java:586)聽
at com.google.firebase.database.w.w.Q(SyncTree.java:569)聽
at com.google.firebase.database.w.o.P(Repo.java:536)聽
at com.google.firebase.database.o$b.run(Query.java:220)聽
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)聽
at java.util.concurrent.FutureTask.run(FutureTask.java:266)聽
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)聽
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)聽
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)聽
at java.lang.Thread.run(Thread.java:923)聽
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@e51ebde rejected from com.google.firebase.database.w.i0.c$a@dbc7f19[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 178]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2086)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:848)
at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:334)
at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:562)
at java.util.concurrent.ScheduledThreadPoolExecutor.execute(ScheduledThreadPoolExecutor.java:654)
at com.google.firebase.database.v.l$e.c(WebsocketConnection.java:106)
at com.google.firebase.database.z.c.n(WebSocket.java:432)
at com.google.firebase.database.z.c.a(WebSocket.java:47)
at com.google.firebase.database.z.c$b.run(WebSocket.java:143)
at java.lang.Thread.run(Thread.java:923)
@rlazo now it starts giving the error with 19.3.0 and 19.3.1 versions as well after I update the Android Studio to 4.1 and the gradle 4.1.0
This issue is breaking the updates to the live apps.
Could you please check this issue as a priority?
The versions of firebase libraries that I'm using in my app:
implementation 'com.google.firebase:firebase-analytics:17.6.0'
implementation 'com.google.firebase:firebase-database:19.3.1'
implementation 'com.google.firebase:firebase-auth:19.4.0'
implementation 'com.google.firebase:firebase-messaging:20.3.0'
implementation 'com.google.firebase:firebase-storage:19.2.0'
implementation 'com.google.firebase:firebase-inappmessaging-display:19.1.1'
implementation 'com.google.firebase:firebase-dynamic-links:19.1.1'
implementation 'com.google.firebase:firebase-config:19.2.0'
implementation 'com.google.firebase:firebase-firestore:21.6.0'
implementation 'com.google.firebase:firebase-functions:19.1.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
UPDATE:
I have downgraded the gradle to 4.0.1
implementation 'com.google.firebase:firebase-database:19.3.1' working fine with Android Studio 4.1 and gradle:4.0.1
This has already been addressed with https://github.com/firebase/firebase-android-sdk/pull/2079. We are currently working on a patch release and are aiming to release it by the end of week.
version 19.5.1 has fixed this issue as mentioned.

Most helpful comment
This has already been addressed with https://github.com/firebase/firebase-android-sdk/pull/2079. We are currently working on a patch release and are aiming to release it by the end of week.