I've encountered one strange bug with Firebase Storage Kotlin SDK. I'm using a putFile()
function to upload an image to Firebase. Everything seems to work just fine, I'm able to achieve that. However when I try to test and disable an internet connection, then that function does not return anything. I mean I've placed all UploadTask
listeners, but neither one of them is called. It just keeps "loading". Has anyone had any similar issues?
val storage = FirebaseStorage.getInstance().reference
val remoteImagePath = "images/username/imageName.jpg"
val imageRef = storage.child(remoteImagePath)
val result = imageRef.putFile(image)
result.addOnSuccessListener {
Log.d("ViewModel", "Success!")
}.addOnFailureListener { error ->
Log.d("ViewModel", "${error.message}")
}.addOnCompleteListener{
Log.d("ViewModel", "Completed!")
}