I am using glide in my kotlin project i am getting the error "Unresolved reference: CustomTarget " . I would like to know how to fix this error.
My code is :
Glide.with(context)
.asBitmap()
.load(url)
.into(object : CustomTarget<Bitmap>() {
override fun onLoadCleared(placeholder: Drawable?) {
}
override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
}
})
What i tried is
Added the following code :
import com.bumptech.glide.annotation.GlideModule import com.bumptech.glide.module.AppGlideModule @GlideModule class RequiredAppGlideModule : AppGlideModule()
Added the following in gradle
implementation 'com.github.bumptech.glide:annotations:4.7.1'
implementation "com.github.bumptech.glide:okhttp3-integration:4.6.1" implementation 'com.github.bumptech.glide:annotations:4.7.1' kapt 'com.github.bumptech.glide:compiler:4.14.2' kapt "android.arch.lifecycle:compiler:1.0.0"
File -> Invalidate caches ,Restart
Reference :
get image from Firebase storage. GlideApp unresolved reference
Unresolved reference: GlideApp in activity written in Kotlin