In short my problem is that I can't use GlideApp (generated API) in an activity written in Kotlin.
Interesting enough that Android Studio sees the reference, i can open the generated GlideApp, there is code completion, but when I try to build it, then it fails with
"Unresolved reference: GlideApp"
The glide module was implemented in java since most of the apps code is written in java.
Any idea?
Are using kapt
instead of annotationprocessor
in gradle file?
V4 Generated API support Kotlin
For those like me who had used kapt
as suggested by karandeep but still had the problem - you have to create an AppGlideModule
implementation:
// AppGlideModule.kt
import com.bumptech.glide.annotation.GlideModule
import com.bumptech.glide.module.AppGlideModule
@GlideModule
class AppGlideModule : AppGlideModule()
After rebuilding the project GlideApp
can be imported (generated code).
More at this medium post
whoever still facing issue after extending AppGlideModule and adding
kapt 'com.github.bumptech.glide:compiler:4.8.0'
then don't forget to include
apply plugin: 'kotlin-kapt'
on top in app or module build.gradle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With