1

Before anyone duplicate it. I was using the below code before in v3.7.0 of glide. Now when I have updated it to 4.7.1 it is showing the error: cannot find symbol method crossFade().

I have searched in different places but could not get the code work.

Glide.with(this)
                    .load(uriProfileImage)
                    .crossFade()
                    .bitmapTransform(new CircleTransform(EditProfile.this))
                    .diskCacheStrategy(DiskCacheStrategy.ALL)
                    .into(changeImage);
Zoe
  • 27,060
  • 21
  • 118
  • 148
Ashish Yadav
  • 543
  • 2
  • 7
  • 30

2 Answers2

1

I haven't used Glide myself, but based on this v4 documentation it looks like you need to use a transition and a TransitionOptions to specify a cross-fade, so your code would look something like this:

import static com.bumptech.glide.load.resource.drawable.BitmapTransitionOptions.withCrossFade;

...

Glide.with(this)
    .load(uriProfileImage)
    .transition(withCrossFade())
    .bitmapTransform(new CircleTransform(EditProfile.this))
    .diskCacheStrategy(DiskCacheStrategy.ALL)
    .into(changeImage);

(I've assumed you want a BitmapTransitionOptions rather than DrawableTransitionOptions here, given the bitmapTransform call.)

You should probably also read the "common errors" section about cross-fades too.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • then it says: Cannot resolve method 'bitmapTransform()' – Ashish Yadav Jul 22 '18 at 10:10
  • @AshishYadav: You may need to move the transition part after the other parts then. (As I have no experience with Glide, you'll need to do further research yourself. Basically I've shown that what was a separate method call before is now something to be specified as a transition.) – Jon Skeet Jul 22 '18 at 10:14
0

I had the same issue, use old version solve the problem. implementation 'com.github.bumptech.glide:glide:3.7.0' than implementation 'com.github.bumptech.glide:glide:4.9.0' which is the last version

PatIbra
  • 1
  • 2