Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebase.database().ref('Users/').on('value', function (snapshot) {console.log(snapshot.val());}); unable to get data #1611

Closed
PrasannaLearnyst opened this issue Oct 17, 2018 · 1 comment

Comments

@PrasannaLearnyst
Copy link

PrasannaLearnyst commented Oct 17, 2018

Issue

registering firebase.database().ref('Users/').on('value', callback) not called on change in data.

firebase.database().ref('Users/').set({ name: nameInput })
The data is updated to firebase database

Android logcat:

-17 22:23:40.001 22863-23301/com.appv2 W/MessageQueue: Handler (android.os.Handler) {2cdbca7b} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (android.os.Handler) {2cdbca7b} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:325)
at android.os.Handler.enqueueMessage(Handler.java:631)
at android.os.Handler.sendMessageAtTime(Handler.java:600)
at android.os.Handler.sendMessageDelayed(Handler.java:570)
at android.os.Handler.post(Handler.java:326)
at com.google.firebase.database.zza.zza(com.google.firebase:firebase-database@@16.0.2:1029)
at com.google.firebase.database.obfuscated.zzcd.zza(com.google.firebase:firebase-database@@16.0.2:47)
at com.google.firebase.database.obfuscated.zzab.zza(com.google.firebase:firebase-database@@16.0.2:286)
at com.google.firebase.database.obfuscated.zzab.zza(com.google.firebase:firebase-database@@16.0.2:346)
at com.google.firebase.database.obfuscated.zzk.zza(com.google.firebase:firebase-database@@16.0.2:5782)
at com.google.firebase.database.obfuscated.zze.zza(com.google.firebase:firebase-database@@16.0.2:2164)
at com.google.firebase.database.obfuscated.zzn.zza(com.google.firebase:firebase-database@@16.0.2:256)
at com.google.firebase.database.obfuscated.zzn.zza(com.google.firebase:firebase-database@@16.0.2:5303)
at com.google.firebase.database.obfuscated.zzn$zzc$2.run(com.google.firebase:firebase-database@@16.0.2:86)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)

app/build.gradle

implementation "com.google.firebase:firebase-core:16.0.3
implementation "com.google.firebase:firebase-database:16.0.2

build.gradle

ext {
compileSdkVersion = 26
targetSdkVersion = 26
buildToolsVersion = "26.0.3"
supportLibVersion = "26.1.0"
googlePlayServicesVersion = "15.0.1"
minSdkVersion = 16
firebaseVersion = "16.0.3"
firebaseMessageVersion = "17.3.2"
googlePlayServicesAuthVersion = "15.0.1"
googlePlayServicesAuthVersionNew = "16.0.0"
firebaseDatabase = "16.0.2"
}

Environment

  1. Application Target Platform:
    Android
    React native : 0.55.4

  2. Development Operating System:
    macOS Sierra

  3. Build Tools:
    react-native cli

  4. React Native version:
    0.55.4

  5. React Native Firebase Version:
    5.0.0

  6. Firebase Module:
    database

  7. Are you using typescript?
    no

@PrasannaLearnyst PrasannaLearnyst changed the title firebase.database().ref('Users/').on('value', function (snapshot) {console.log(snapshot.val());}); firebase.database().ref('Users/').on('value', function (snapshot) {console.log(snapshot.val());}); unable to get data Oct 17, 2018
@Salakar
Copy link
Member

Salakar commented Oct 18, 2018

Duplicate of #1498

@Salakar Salakar marked this as a duplicate of #1498 Oct 18, 2018
@Salakar Salakar closed this as completed Oct 18, 2018
@invertase invertase locked as spam and limited conversation to collaborators Oct 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants