Search code examples
androidimageviewpicassofirebase-storage

Object Not Fount Exception when I am trying to set FirebaseStorage Image file in ImageView in Android


I am developing an app where I want to display uploaded image from firebase storage by setting it to an Imageview using url. I am using following code to get this done.

     StorageReference storageReference = FirebaseStorage.getInstance().getReference("ImageFolder/"+imageId);
     storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
                        @Override
                        public void onSuccess(Uri uri) {  
                          Picasso.with(getContext()).load(uri).into(viewHolder.imageThumbnail);                          
                        }
                    }).addOnFailureListener(new OnFailureListener() {
                        @Override
                        public void onFailure(@NonNull Exception exception) {
                            // Handle any errors
                        }
                    });

This throws an Exception as following

StorageException has occurred. Object does not exist at location. Code: -13010 HttpResult: 404 08-09 22:50:05.280 10915-11000/com.app.myapp E/StorageException: { "error": { "code": 404, "message": "Not Found. Could not get object" }} java.io.IOException: { "error": { "code": 404, "message": "Not Found. Could not get object" }} at bxr.a(:com.google.android.gms.DynamiteModulesC:424) at bxr.a(:com.google.android.gms.DynamiteModulesC:1404) at bxl.onTransact(:com.google.android.gms.DynamiteModulesC:53) at android.os.Binder.transact(Binder.java:387) at com.google.android.gms.internal.zzamj$zza$zza.zzss(Unknown Source) at com.google.android.gms.internal.zzamm.zza(Unknown Source) at com.google.android.gms.internal.zzamd.zza(Unknown Source)

Please help with the issue.


Solution

  • I have a same issues , in my app i was saving URL in Database and image in Storage.

    just Clean entire STORAGE and DATABASE thing and its works well in my case.

    or

    i found it why its happen..

    it returns non-null firebase.Promise containing string A Promise that resolves with the download URL or rejects if the fetch failed, including if the object did not exist.

    Check here for this method getDownloadURL()