【问题标题】:Kotlin Glide gives the error: Request threw uncaught throwableKotlin Glide 给出错误:Request throwed uncaught throwable
【发布时间】:2021-06-17 14:38:34
【问题描述】:

我正在尝试将图像从 Firebase 加载到图像视图中。 我的图像是(test.jpg)在 Firestore 的文件夹(产品)中 我尝试使用以下代码将此图像加载到图像视图中:

    val imageView = findViewById<ImageView>(R.id.image)
    val storageref = Firebase.storage.reference
    val path = storageref.child("products")
    val LoadImage = "test.jpg"
    val pathReference = path.child(LoadImage)
    Glide.with(this)
        .load(pathReference)
        .into(imageView)

这应该是正确的。但我确实收到了这个错误:

请求抛出未捕获的 throwable com.bumptech.glide.Registry$NoModelLoaderAvailableException:找不到模型的任何模型加载器:gs://xxxx.appspot.com/products/test.jpg

有谁知道我做错了什么?

【问题讨论】:

    标签: kotlin google-cloud-firestore android-glide


    【解决方案1】:

    我认为这是因为对存储的引用不是用于 Glide 的有效 URL。

    查看这个答案https://stackoverflow.com/a/48762436/15259160

    【讨论】:

    • 感谢这项工作!我需要添加一个实现和一个 kotlin 类。
    猜你喜欢
    • 2020-08-19
    • 2017-05-02
    • 2016-10-01
    • 1970-01-01
    • 2021-04-27
    • 1970-01-01
    • 2015-09-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多