Vasile Doe
Vasile Doe

Reputation: 1754

Glide cannot resolve method .asGif()

I have the code:

  Glide.with(getActivity())
  .load(myurl)
  .asGif()
  .into(ivGif);

and I imported glide in gradle:

  repositories {
  mavenCentral()
  maven { url 'https://maven.google.com' }
  }

dependencies {
  compile 'com.github.bumptech.glide:glide:4.2.0'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'
}

Compiler says

cannot resolve method .asGif()

Do I miss something?

Upvotes: 3

Views: 3594

Answers (1)

On older versions of Glide you can use like this:

GlideDrawableImageViewTarget imageViewTarget = new GlideDrawableImageViewTarget(imageView, LOOP_COUNT);
Glide.with(mContext)
    .load(yourgif)
    .into(imageViewTarget);

As of Glide version 4.x, asGif() method is removed. You can handle gif just like this:

Glide.with(mContext)
    .load(yourgif)
    .into(imageView);

Upvotes: 5

Related Questions