2
試圖加載具有相似的網址相似圖片滑翔無法加載服務器映像網址
"https://firebasestorage.googleapis.com/v0/b/content-office-e1931.appspot.com/o/usersData%2Fposts%2Fmedia_-KpGAURJbB33BKhTynV1?alt=media&token=26135949-a918-4572-9293-b639d43f04aa"
但滑翔顯示日誌
Load failed for with size [360x360]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
上一頁日誌
Failed to find GeneratedAppGlideModule. You should include an annotationProcessor
compile dependency on com.github.bumptech.glide:glide:compiler in your application
and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules
will be silently ignored
我無法理解爲什麼我應該添加AppGlideModule等來加載圖像。我在科特林代碼,我增加了編譯器的依賴性如下
//image loader
compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
kapt 'com.github.bumptech.glide:compiler:4.0.0-RC1'
這裏是我叫滑翔
fun bind(post: Post) {
for ((k, v) in post.media) {
Glide.with(itemView.context)
.asBitmap()
.apply(RequestOptions.encodeQualityOf(70))
.apply(RequestOptions.overrideOf(width,width))
.apply(RequestOptions.centerCropTransform())
.load(v.downloadPath)
.into(image)
}
}
我曾試圖附加一個偵聽器來查看日誌,當滑翔嘗試加載發生了什麼圖像,但我只看到「無法加載資源」沒什麼
也許與這個問題有關,https://github.com/bumptech/glide/issues/2039 –
檢查你是否在for循環中加載了正確的索引和值 – Nithinlal
@Nithinlal,肯定是正確的,就像第一條評論,它是真的與這個問題有關。 –