2

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.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

2 Answers2

0

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()

Rajesh Satvara
  • 3,842
  • 2
  • 30
  • 50
0

This occurs when there is not an item in firebase storage at the specified location.

Here is what the exception looks like in Android:

04-13 07:07:48.851 20923-22411/org.emeritus.globalivy 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 bti.a(:com.google.android.gms.DynamiteModulesC:428)
                                                                              at bti.a(:com.google.android.gms.DynamiteModulesC:1408)
                                                                              at btc.onTransact(:com.google.android.gms.DynamiteModulesC:53)
                                                                              at android.os.Binder.transact(Binder.java:380)
                                                                              at com.google.android.gms.internal.zzbub$zza$zza.zzjM(Unknown Source)
                                                                              at com.google.android.gms.internal.zzbue.zzd(Unknown Source)
                                                                              at com.google.android.gms.internal.zzbtv.zza(Unknown Source)
                                                                              at com.google.android.gms.internal.zzbtv.zze(Unknown Source)
                                                                              at com.google.firebase.storage.zzb.run(Unknown Source)
                                                                              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)

It would be nice if the Firebase SDK didn't output the entire stacktrace to the logs and only this

StorageException has occurred.
                                                                          Object does not exist at location.
dazza5000
  • 7,075
  • 9
  • 44
  • 89