Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting NPE in FirebaseDatabase.getReference()

I am getting NPE in production build on app start and only once after reinstalling with adb.

Caused by java.lang.NullPointerException
Attempt to invoke interface method 'void com.google.firebase.database.obfuscated.f.a(java.lang.Runnable)' on a null object reference
com.google.firebase.database.obfuscated.zzab.zza (SourceFile:276)
com.google.firebase.database.obfuscated.zzab. (SourceFile:90)
com.google.firebase.database.obfuscated.zzad.zzb (SourceFile:101)
com.google.firebase.database.obfuscated.zzad.zza (SourceFile:42)
com.google.firebase.database.FirebaseDatabase.zza (SourceFile:357)
com.google.firebase.database.FirebaseDatabase.getReference(SourceFile:201)

I suppose I should not get NPE no matter what reference I am passing to getReference() method - although I am passing correct one.

This seems to happen with following firebase versions:

firebase_core_version = "16.0.3"
firebase_auth_version = "16.0.3"
firebase_database_version = "16.0.2"

I am unable to reproduce it using:

firebase_core_version = "16.0.0"
firebase_auth_version = "16.0.1"
firebase_database_version = "16.0.1"
like image 516
gswierczynski Avatar asked Feb 19 '26 10:02

gswierczynski


1 Answers

I downgraded firebase-ui-database from 4.2.0 to 4.1.0 and the problem went away

like image 57
Ishaan Garg Avatar answered Feb 22 '26 00:02

Ishaan Garg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!