Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams 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?

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);
                @Dika My answer is a bit outdated. After Glide upgrades v4, this class has been removed. You can check this answer to find an alternative to GlideDrawableImageTarget. stackoverflow.com/a/51531284/3669559
– Oğuzhan Döngül
                Feb 23, 2019 at 7:42
                @Dika I was thinking about updating my answer when I am available but you changed my answer entirely. I made my answer more comprehensive. Still some people use older versions of Glide library.
– Oğuzhan Döngül
                Feb 23, 2019 at 9:27
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.