问题
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);
回答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.
回答2:
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
来源:https://stackoverflow.com/questions/51463988/error-cannot-find-symbol-method-crossfade-in-4-7-1