Glide 不从缓存位置加载图像

Glide does not load image from cache location

我使用以下代码将图像从 firebase storage 下载到本地文件:

val sharedReference = FirebaseStorage.getInstance().getReferenceFromUrl("url to my bucket")
    val localFile = File.createTempFile("images", "jpg")
    sharedReference.getFile(localFile).addOnSuccessListener {
   
    Glide.with(context).load(localFile.toUri().path).into(myImageView)

    }

但是 url 我从那里回来的是这样的:

/data/user/0/com.example.myapp/cache/images1018011169077473514jpg

并且glide不会加载图片。如何在imageView中使用glide加载图片。

任何帮助或建议将不胜感激。

不要创建临时文件,直接通过 Glide 显示图像。 它无论如何都会缓存它。