0

I have this path in my firestore (com.google.android.gms.tasks.zzu@540f03f). How get image from storage use that path

This is the code that I am using

userImageRef= FirebaseStorage.getInstance().getReferenceFromUrl(MainActivity.avbUser.getProfilePic());
    userImageRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
        @Override
        public void onSuccess(Uri uri) {
            imgUrl=uri.toString();
        }
    });

The error that I get

Process: com.example.fastfoods, PID: 939 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fastfoods/com.example.fastfood.buyerhome}: java.lang.IllegalArgumentException: The storage Uri could not be parsed. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2576) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2658) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1492) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5737) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679) Caused by: java.lang.IllegalArgumentException: The storage Uri could not be parsed. at com.google.firebase.storage.FirebaseStorage.getReferenceFromUrl(com.google.firebase:firebase-storage@@17.0.0:279) at com.example.fastfood.buyerhome.onCreate(buyerhome.java:39) at android.app.Activity.performCreate(Activity.java:6309)

Cyrille Con Morales
  • 918
  • 1
  • 6
  • 21
  • Possible duplicate of [Retrieve image from Firebase Storage](https://stackoverflow.com/questions/55876667/retrieve-image-from-firebase-storage) – Kiran Maniya Sep 04 '19 at 03:12
  • In Firebase there's no such path like com.google.android.gms.tasks.zzu@540f03f you're possibly getting some other path of storage check this answer it'll help :- https://stackoverflow.com/questions/53430319/cannot-retrieve-images-from-firebase-storage – Mr. Patel Sep 04 '19 at 03:41

0 Answers0