美文网首页
Unresolved reference: GlideApp【K

Unresolved reference: GlideApp【K

作者: and2long | 来源:发表于2019-05-09 22:31 被阅读0次

最近在项目中,遇到问题:GlideApp死活无法解析出来,查看Glide项目文档,很明显写着这样引入使用:

dependencies {
  implementation 'com.github.bumptech.glide:glide:4.9.0'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}

然后检查自己的代码,一模一样。多次点击🔨图标Make Project,始终提示Unresolved reference: GlideApp

反复搜索,终于在stackoverflow和Glide项目的issues中找到答案。

简单说明一下:

因为自己使用的Kotlin语言,所以在app的build.grandle中引入Glide时,需要用 kapt代替annotationprocessor
像下面这样:

dependencies {
  implementation 'com.github.bumptech.glide:glide:4.9.0'
  kapt 'com.github.bumptech.glide:compiler:4.9.0'
}

再点击🔨图标运行,就OK啦。

相关文章

网友评论

      本文标题:Unresolved reference: GlideApp【K

      本文链接:https://www.haomeiwen.com/subject/szhnoqtx.html