Comments (6)
I found a few problems with this issue:
- I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
- This issue does not seem to follow the issue template. Make sure you provide all the required information.
from firebase-android-sdk.
Hi @Kevinnad, thank you for reaching out. I tried reproducing the issue using our quickstart, however, I wasn't able to encounter the exception.
Here's how I implement it:
databaseRef = Firebase.database
val myRef = databaseRef.getReference("Devices")
val isDeviceConnectedRef = myRef.child("myDevice").child("id")
isDeviceConnectedRef.addValueEventListener(object : ValueEventListener {
override fun onDataChange(dataSnapshot: DataSnapshot) {
val newValue = dataSnapshot.getValue(String::class.java) ?: ""
Log.d(TAG, "Value is: $newValue")
}
override fun onCancelled(error: DatabaseError) {
// Failed to read value
Log.w(TAG, "Failed to read value.", error.toException())
}
})
Did I misunderstood anything?
Can you share an MCVE or code snippet to help us investigate the issue? If you're unable to provide one, can you try our quickstart app and see if you can reproduce the issue?
Aside from that, are you constantly experiencing this error? or does the issue occur on certain devices and/or android versions?
from firebase-android-sdk.
Hey @Kevinnad. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
from firebase-android-sdk.
Hi @lehcar09 thanks for taking this issue
You first need to try with get
, then same query with ValueEventListener, also try for multiple parallel request like the below snippet.
val itemList = ArrayList<Object>()
GlobalScope.launch {
snapshots.map { snapshot ->
return@map async(Dispatchers.Main) {
val dataSnapshot = databaseReferenceA().child(snapshot.key).get().await()
val result = dataSnapshot.getValue(Object::class.java)
return@async
} else {
return@async
}
}
}.awaitAll()
After the above code executed, call the below one of same DB reference
snapshots.map { snapshot ->
databaseReferenceA().child(snapshot.key).addValueEventListener(object : ValueEventListener {
override fun onDataChange(dataSnapshot: DataSnapshot) {
val newValue = dataSnapshot.getValue(String::class.java) ?: ""
Log.d(TAG, "Value is: $newValue")
}
override fun onCancelled(error: DatabaseError) {
// Failed to read value
Log.w(TAG, "Failed to read value.", error.toException())
}
})
}
from firebase-android-sdk.
I tried the code snippet you shared, however, I still wasn’t able to experience the issue. So far, it looks to me that there’s no issue on the SDK side.
I’m thinking if it’s possible that there are overlapping parallel calls happening at the same time that might be causing unwanted race conditions. Could you share an MCVE to further investigate the issue?
from firebase-android-sdk.
Hey @Kevinnad. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
from firebase-android-sdk.
Related Issues (20)
- "Circular dependency" with `injectCrashlyticsMappingFileId` task in `firebase-crashlytics-gradle` version `3.0.0` HOT 3
- Firebase App Distribution 17.0.0 isn't available HOT 3
- App crash while launch HOT 5
- Crash (FirebaseApp is not initialized in this process) or ANR(executing service ***/com.onfido.android.sdk.capture.ui.OnfidoStarterService) with firebase-perf and Onfido start activity for result HOT 4
- Tasks circular dependency in `firebase-crashlytics-gradle` 3.0.0 when databinding enabled HOT 2
- java.lang.IllegalArgumentException: Service not registered HOT 2
- com.google.android.gms.measurement.internal.zzjx.onActivityCreated crash in android 7 HOT 9
- [firebase_crashlytics] clarify the "Proximity on" on the device status tab HOT 2
- Asking for self repository for project HOT 4
- Repeated Listen Calls observed via GCP Audio Logs HOT 7
- :app:uploadCrashlyticsMappingFileRelease build task fails after upgrading to crashlytics plugin version 3.0.1 HOT 16
- Requests from Transistor SDK are not been automatically intercepted HOT 4
- Firestore query snapshot with changes only HOT 3
- firebase-messaging build error on windows HOT 11
- Error: All gms/firebase libraries must use the exact same version specification [GradleCompatible] HOT 14
- FATAL EXCEPTION: main Process: java.lang.RuntimeException: Internal error in Cloud Firestore (25.0.0). HOT 7
- [firebase_auth] This app is not authorized to use Firebase Authentication HOT 2
- hello
- FirebaseMessaging : Disable retry Topic operation upon connection without internet HOT 2
- Android Build Error: Duplicate Class with Protobuf When Adding Firebase In-App Messaging in gradle HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-android-sdk.