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

前端 未结 6 648
孤独总比滥情好
孤独总比滥情好 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:32

    You can try to wait some time between the upload of the image and the recuperation of the image. That worked in my issue like this. Wish you a good luck.

    0 讨论(0)
  • 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)
    
    0 讨论(0)
  • 2020-12-11 16:46

    I had a similar problem. I was trying to delete a file with some wrong case letters

    Example: Deleting file_of_user_uidabcde.png by searching for file_of_user_uIdAbCdE.png

    0 讨论(0)
  • 2020-12-11 16:47

    I had the same problem right now and I realized that my image in storage ends with .jpg but my code is asking for the address that ends with .png. After I fixed that, it ran perfectly for me.

    0 讨论(0)
  • 2020-12-11 16:55

    hi i faced such problem two days ago. storage exception occurs normally to the projects which you created with google developer console prior to Firebase launch. so when i connected my app to existing project on Firebase it worked. to confirm whether your project accepts storage or not go to Firebase console and on left click storage if you were displayed with the file upload option there the project is capable of storage other wise not.

    0 讨论(0)
  • 2020-12-11 16:56

    In my case, I am saving the complete URL in the Firebase database and get it like this: gs: //your-id.appspot.com/images/cross.png

    When I do this:

    StorageReference ref = FirebaseStorage().Ref().Child(urlImag);
          url = (await ref.getDownloadURL()).toString();
    

    I am doing the following:

    StorageReference ref = FirebaseStorage (gs://your-id.appspot.com/images/cross.png).ref().child ();
          url = (await ref.getDownloadURL()).toString();
    

    This step is not necessary if you already have the full URL saved in your field.

    0 讨论(0)
提交回复
热议问题