skip to Main Content

I am trying to use Glide to load images from url in my android app in java

Glide.with(holder.itemView.getContext())
            .load(newsItem.getImageUrl())
            .into(holder.imageView);

Glide is giving an error ‘Cannot resolve symbol ‘Glide” for which i tried adding dependencies in my build.gradle.kts (module:app) file and isn’t working for me, am i doing anything wrong here?
enter image description here

2

Answers


  1. Your build.gradle.kts contains syntax errors that is why Android Studio fails to include Glide to the project.
    The error message is quite misleading, but judging by screenshot, you are using wrong type of quotes around strings. In KTS one needs " instead of '

    Login or Signup to reply.
    1. first make these changes in ‘libs.versions.toml’
      enter image description here

    2. then in build.gradle.kts, make following changes
      enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search