错误:找不到符号方法getDownloadUrl()和Riod Studio项目

时间:2019-10-16 17:17:49

标签: android

我在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
                        // ...
                    }
                });
    }
}

0 个答案:

没有答案