【发布时间】:2020-06-28 00:02:49
【问题描述】:
我正在尝试使用 Kotlin 和 Glide 从 Firebase 存储加载图像。我添加了所有依赖项并应用插件:
implementation 'com.firebaseui:firebase-ui-storage:6.2.0'
implementation 'com.google.firebase:firebase-storage-ktx:19.1.1'
implementation 'com.github.bumptech.glide:glide:4.8.0'
kapt 'com.github.bumptech.glide:compiler:4.9.0'
apply plugin: 'kotlin-kapt'
我的代码如下:
val storageRef = Firebase.storage.reference
val imageref = storageRef.child("test/test.jpg")
imagetest = findViewById(R.id.imageView5)
Glide.with(this)
.load(imageref)
.into(imagetest)
运行代码时,具有默认图像的图像视图变黑,表示代码正在尝试从 Firebase 存储中检索某些内容。但 imageView 永远不会填充下载的图像。假设下载确实发生了。
我做错了吗?我的 Firebase 存储屏幕截图如下:
我对此进行了更多测试,无论我从哪里提取 URL,Glide 似乎都可以从 HTTPS 加载图像。但是云存储提供的 URL 为 GS://。那么如何将 GS:// 转换为 HTTPS://?
请帮忙。
【问题讨论】:
标签: kotlin firebase-storage android-glide