StorageException has occurred. Object does not exist at location. Storage FireBase

前端 未结 6 664
孤独总比滥情好
孤独总比滥情好 2020-12-11 16:19

I want display image in imageView, that\'s what I\'m doing: I\'m using FirebaseUI to display images from FireBase Storage.

FirebaseStorage storageDisplayImg;         


        
6条回答
  •  甜味超标
    2020-12-11 16:42

    You can Simply show the image in two way using Glide method. If we want to access below method, We must to change the Firebase Storage Rules. Here I included my rules.

      service firebase.storage {
      match /b/project-id.appspot.com/o {
      match /{allPaths=**} {
       allow write: if request.auth != null;
    
      }
      }
     } 
     OR  allow write:ture;
    

    Method 1. Simply use the Firebase Reference

    FirebaseStorage storage = FirebaseStorage.getInstance();
                    StorageReference storageRef = storage.getReferenceFromUrl("gs://your-id.appspot.com");
                    StorageReference pathReference = storageRef.child("images/cross.png");
    
                    Glide.with(context)
                            .using(new FirebaseImageLoader())
                            .load(pathReference)
                            .into(Imageview)
    

    Method 2. Firebase URL

         Glide.with(context)
                        .using(new FirebaseImageLoader())
                        .load("Firebase_ImageURL")
                        .into(Imageview)
    

提交回复
热议问题