【问题标题】:"Firebase storage exception: object does not exist" I don't know why“Firebase 存储异常:对象不存在”我不知道为什么
【发布时间】:2019-12-29 02:39:47
【问题描述】:

发生 Firebase 存储异常。据说该对象不存在但是当我检查调试窗口和 Firebase 控制台时,它就在那里。请帮帮我。

我尝试了“Glide”库,但“Using”方法不可用。我也尝试使用“FirebaseImageLoader”和“load”方法,但失败了。我想在不使用“Glide”库的情况下将图像连接到 ImageView。

StorageReference storageReference = FirebaseStorage.getInstance().getReference();
StorageReference photoReference= storageReference.child("Image/"+fileName);

final long ONE_MEGABYTE = 1024 * 1024;

photoReference.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>() {
            @Override
            public void onSuccess(byte[] bytes) {
                   Bitmap bmp = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
                   imageView.setImageBitmap(bmp);

            }
        }).addOnFailureListener(new OnFailureListener() {
            @Override
            public void onFailure(@NonNull Exception exception) {
                Toast.makeText(getApplicationContext(), "No Such file or Path found!!", Toast.LENGTH_LONG).show();
            }
        });

“photoReference”的值(url)与 Firebase 控制台中我的图像的“存储位置”相同。那么为什么会出现对象不存在的异常呢?我很好奇。

【问题讨论】:

  • 只需传递 url 即可滑动

标签: android firebase


【解决方案1】:

【讨论】:

猜你喜欢
  • 2020-02-12
  • 1970-01-01
  • 2020-08-02
  • 2016-11-11
  • 1970-01-01
  • 1970-01-01
  • 2020-11-21
  • 2012-01-11
  • 2016-05-08
相关资源
最近更新 更多