Search code examples
androidkotlinandroid-glide

How do i fix glide with keyword error in kotlin


Im trying to use glide on my fragment but "with" keyword is getting an error on my IDE.

Here is my code

val stringUri = this.arguments?.getString("uriFoto")
val uri = stringUri!!.toUri()
Glide.with(context).load(uri).into(binding.ivProfil)

Code Screenshot

and here is my glide classs code

import com.bumptech.glide.module.AppGlideModule
import com.bumptech.glide.annotation.GlideModule

@GlideModule
class Glide : AppGlideModule()  {
}

Solution

  • check import package of glide library. import the below two packages

    1)import com.bumptech.glide.Glide 2)import com.bumptech.glide.request.RequestOptions