我在getDownloadurl()
中遇到问题。只是出现此错误错误:cannot find symbol method getDownloadUrl()
我不确定如何解决它:
private void uploadfile(){
if(filepath != null) {
StorageReference riversRef = storageReference.child("images/profile.jpg");
riversRef.putFile(filepath)
.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
// Get a URL to the uploaded content
Uri downloadUrl = taskSnapshot.getDownloadUrl();
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle unsuccessful uploads
// ...
}
});
}
}