i am having trouble with Glide from past 2 days. It was working fine but when the update came for Glide depandency it gives me error in my previous code.
here is my code:
private void showImage(Uri uri, int dimenInPx) {
Glide.with(context)
.load(uri)
.override(dimenInPx, dimenInPx)
.transform(new CircleTransform(context))
.placeholder(R.mipmap.ic_display_pic)
.into((ImageView) findViewById(R.id.img_displayPic));
}
.override, .transform and .placeholder is not identifying by Glide.
My Gradle file:
compile 'com.github.bumptech.glide:glide:3.7.0'
Yes i know this is old version, but i even tried with latest version which is...
compile 'com.github.bumptech.glide:glide:4.3.1'
I don't know where i am doing wrong. Please help me out. Thanks
Update 1: I update Glide to latest depandency and then modified my code which is provided by @Ratilal and it looks like this now:
Glide.with(context)
.load(uri)
.apply(new RequestOptions()
.override(dimenInPx, dimenInPx)
.placeholder(R.mipmap.ic_display_pic)
.transform(new CircleTransform(context)))
.into((ImageView) findViewById(R.id.img_displayPic));
So now the error is gone, but i get run time NoSuchMethodError.
No virtual method load(Landroid/net/Uri;)Lcom/bumptech/glide/DrawableTypeRequest; in class Lcom/bumptech/glide/RequestManager; or its super classes (declaration of 'com.bumptech.glide.RequestManager' appears in /data/app/com.scoratech.scoraxchange-1/split_lib_dependencies_apk.apk)