Before gradle update everything worked fine, but later on this error popped up. I have referred to the official documents and it provides the same code. Not accepting the ge
For kotlin
val uploadTask = fileReference.putFile(Uri.fromFile(primaryFile), metadata)
and
uploadTask
.addOnProgressListener { taskSnapshot ->
}
.addOnPausedListener {
}
.addOnSuccessListener { taskSnapshot ->
}
.continueWithTask { task ->
if (!task.isSuccessful) {
throw task.exception!!
}
fileReference.downloadUrl
}
.addOnCompleteListener { task ->
if (task.isSuccessful) {
val downloadUrl: Uri = task.result
} else {
// Handle failures
}
}
.addOnFailureListener { e ->
}
val downloadUrl is your URL that is uploaded.