0

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

  1. Added the following code :

     import com.bumptech.glide.annotation.GlideModule
     import com.bumptech.glide.module.AppGlideModule
    
     @GlideModule
     class RequiredAppGlideModule : AppGlideModule()
    
  2. 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"
    
  3. File -> Invalidate caches ,Restart

Reference :

get image from Firebase storage. GlideApp unresolved reference

Unresolved reference: GlideApp in activity written in Kotlin

Glide cannot resolve asBitmap()

How does one use glide to download an image into a bitmap?

tomerpacific
  • 4,704
  • 13
  • 34
  • 52
Rahul R
  • 303
  • 2
  • 11

0 Answers0