Strange error! what is the issue behind this?
Recently only, I'm seeing this error :(
compile 'com.google.firebase:firebase-database:9.0.2'
compile "'om.google.firebase:firebase-auth:9.0.2'
E/RunLoop: Uncaught exception in Firebase runloop (3.0.0). Please report to [email protected]
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.internal.zzafg.zzg(com.google.android.gms.internal.zzafa, com.google.android.gms.internal.zzahu)' on a null object reference
at com.google.android.gms.internal.zzafc.zzb(Unknown Source)
at com.google.android.gms.internal.zzafc.zzat(Unknown Source)
at com.google.firebase.database.connection.idl.IPersistentConnectionImpl$3.zzJ(Unknown Source)
at com.google.firebase.database.connection.idl.zzi$zza.onTransact(Unknown Source)
at android.os.Binder.transact(Binder.java:387)
at alx.a(:com.google.android.gms.DynamiteModulesC:211)
at amb.a(:com.google.android.gms.DynamiteModulesC:339)
at akf.a(:com.google.android.gms.DynamiteModulesC:6851)
at ajt.a(:com.google.android.gms.DynamiteModulesC:5191)
at akw.b(:com.google.android.gms.DynamiteModulesC:226)
at akw.a(:com.google.android.gms.DynamiteModulesC:271)
at ald.run(:com.google.android.gms.DynamiteModulesC:1020)
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.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)
Guys any update on this?
mFirebaseDatabase.setPersistenceEnabled(true);
I've enabled database persistance. whenever i get the above crash, unable to proceed my app further! It's keep on crashing every time; until I clear the App data.
Kindly update some solution / workaroud.
Thanks in advance!
@Karthi-R sorry for the delayed response here. This is being discussed on the firebase-talk mailing list, you can check out the thread here:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/firebase-talk/iy0762S3KsU/G46mNG6KAAAJ
You can also discuss on StackOverflow:
http://stackoverflow.com/questions/37724801/uncaught-exception-in-firebase-runloop-3-0-0
The team is aware of the issue and looking into it, here's the latest response:
"""
Hey guys,
We've seen this crash before and it happens when the Database offline cache is in an invalid state. So far this has always been due to using Firebase Database from a multi-process app. Usually people are not creating multiple processes on purpose but some dependency (e.g. firebase-crash) is doing it on their behalf. And keep in mind that even if you change your code so that it's no longer multi-process (e.g. remove the dependency that was creating the second process), you may still hit the crash on app start until you clear your application data since the corrupted data will still be on disk.
So I would:
Try to make sure none of your dependencies create a second process.
Make sure you're not initializing FirebaseDatabase from your Application class (which gets created for every process in your app).
If you're already hitting the crash, clear your application data (from Settings > Apps > your app).
If you still run into this issue, it would be immensely helpful if you could provide a set of steps to reproduce it (ideally an example app with source code that we can run) so we can track down the root cause.
Thanks!
-Michael
"""
@samtstern - Already tried all the steps mentioned - still the crashes keep occurring. Where can I email the example app with the source code?
@samtstern - Have emailed you the source code to reproduce the bug. The exact same code doesn't crash using the old client, but crashes on the new ones (9.2.0 & 9.0.2).
Is this fixed? I am also facing the same issue
We can reproduce this consistently with fixed endAt and startAt query parameters on 9.0.2 and 9.2.0. Here are the details: http://stackoverflow.com/a/38348574/1252289
Clearing app data worked for me.. I don't know how.. but it worked.. Maybe autobackup was getting my previous data back..
@kirtan403 could you explain how did you solved? Please
Ohh.. I am so sorry! I just posted on the wrong thread! But yes, I have updated the answer.. See my previous comment
Same error. Can't disabled persistent as I need offline support. @puf Any other work around?
@samtstern - I have tried the new SDK 9.4.0 and the issue still persist. It arose when we used startAt() and endAt() for the first time. Our app is not multiprocess one (checked via the methods provided on StackOverflow) and we do not use the crash SDK.
There seems to be no progress on the mailing list, StackOverflow or this issue for a long time. Has it been tracked somewhere at Google? Have you got a chance to reproduce it? And why the issue is closed?
Here is an excerpt from a response from the Firebase support team:
Apologies for any inconvenience this might have caused your development. We are already aware of this issue, wherein queries with integer startAt / endAt values could get written multiple times to persistence causing tracked queries to be corrupt, leading to a crash. However, I cannot give you any timeline for the release. Rest assured that we are actively working hard to address this issue.
In the meantime, try to avoid having queries with endAt or startAt when data persistence is enabled.
Keep an eye on our release notes for further update. Again, sorry for the inconvenience.
Any progress?
Any alternative way to solve this problem?
@viksoffice @tsadoklf you can expect a fix in the next release, in the meantime there is not a good workaround if you require startAt, endAt, and persistence.
@samtstern will there be a fix for the multi process problem or a fix for the startAt and endAt stuff?
My app crashes all the time during development because of the dirty offline cache state. I can't release it in this state
@RichardGottschalk a fix for the startAt/endAt problem is coming, unfortunately I can't offer any fixed timelines.
@samtstern can you at least mark the issue as open, please?
@curiousily I understand your motivation, but we try to only keep open issues here that may be bugs with the quickstart itself, this is not a general Firebase issue tracker.
We're certainly tracking this as an open issue internally until the fix is rolled out publicly.
The same problem is happening with equalTo() method. Is there any usage of startAt/endAt inside equalTo?
@rafaelperatello same problem here.
@samtstern Thank you for the response. That is all ok. Where can we (as users) track the progress on the fix?
Hey all,
We do appreciate that you're all waiting for a fix. Github (and this repo) is not the best place to track this. I'd recommend discussing with the community either on StackOverflow or the firebase-talk mailing list.
Here's a popular SO question on this error: http://stackoverflow.com/questions/37724801/uncaught-exception-in-firebase-runloop-3-0-0
And here's a thread on the mailing list: https://groups.google.com/d/topic/firebase-talk/iy0762S3KsU/discussion
I will also try to update here when the fix is in place, but won't be providing GIthub updates on timelines or intermediate solutions until then.
There is a new Android SDK released. It says this:
Fixed a hardAssert failed exception that could occur when offline persistence is enabled and certain startAt() and endAt() queries were used.
I think this issue is resolved. Right @samtstern ?
I still see this issue while using transaction with version 9.0.8.
Code to reproduce the same with 9.0.8 or 10.2.0
`
postRef.runTransaction(new Transaction.Handler() {
@Override
public Transaction.Result doTransaction(MutableData mutableData) {
BoPostRent p = mutableData.getValue(BoPostRent.class);
if (p == null) {
return Transaction.success(mutableData);
}
if (p.stars.containsKey(getUid())) {
String wishlistId = p.stars.get(getUid());
wishlistRef.child(wishlistId).removeValue();
// Unstar the post and remove self from stars
p.starCount = p.starCount - 1;
p.stars.remove(getUid());
} else {
// Star the post and add self to stars
String wishlistId = wishlistRef.push().getKey();
property.setPostedOn(Common.getTimestampString());
property.setPostedOnLong(Common.getTimestampLong());
wishlistRef.child(wishlistId).setValue(property);
p.starCount = p.starCount + 1;
p.stars.put(getUid(), wishlistId);
}
// Set value and report transaction success
mutableData.setValue(p);
return Transaction.success(mutableData);
}
@Override
public void onComplete(DatabaseError databaseError, boolean b,
DataSnapshot dataSnapshot) {
// Transaction completed
if (databaseError == null)
toast("Your wishlist has been updated successfully");
else {
log("postTransaction:onComplete:" + databaseError);
toast("Failed to add item into your wishlist. Please try again");
}
}
});
`
facing the same issue. i am not using persistentStorage and this issue is coming only for production @samtstern
Fatal Exception: java.lang.RuntimeException: Uncaught exception in Firebase Database runloop (3.0.0). Please report to [email protected]
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:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
apply plugin: 'com.google.gms.google-services'
check if above dependency added if not add it and retry.
This worked for me
Most helpful comment
The same problem is happening with equalTo() method. Is there any usage of startAt/endAt inside equalTo?