前言
記錄開發中遇到的 bug,不再讓自己重複地被同樣的 bug 折磨。
正文
1. 從 Java 轉向 Kotlin,使用 Glide,但是 GlideApp 卻無法生成
時間:2019年7月29日21:53:28
解決辦法:
把 dependencies 中的
dependencies {
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
替換爲
apply plugin: 'kotlin-kapt'
dependencies {
implementation 'com.github.bumptech.glide:glide:4.9.0'
kapt 'com.github.bumptech.glide:compiler:4.9.0'
}
可以參考這個文檔:https://kotlinlang.org/docs/reference/kapt.html。
最後
代碼出錯了,關鍵是要仔細查看日誌。能夠仔細地查看日誌,就離解決問題很近了。