cannot find symbol method with() using picasso library android

梦想的初衷 提交于 2019-11-27 21:02:14

It looks like in the latest Picasso Snapshot that you are using the method with hast been renamed to get see related commit here: https://github.com/square/picasso/commit/e7e919232fe2b15772a7fcd9e15ead2304c66fae

so replace with() with get() and should work.

Since you are using a not yet officially released version, there are no release notes yet, and surprizes like that can happen ;-)

BTW: It seems to be a good name change to me, since a method named "with" but without parameter was a bit weird :-P

Use get() Instead of with() it will work

Picasso.get().load("image_URL").into(imageView);

with() hast been renamed to get()

We have to replace with() with get() and very important, now the context is not necessary for this method.

 Picasso.get().load(url).into(view);

Add into the build.gradle file the dependency described into the documentation:

implementation 'com.squareup.picasso:picasso:2.71828'

Picasso documentation.

Md Nakibul Hassan

In the latest Picasso library, they renamed with() into get()

So, instead of using

Picasso.with(context).load(url).placeholder(R.drawable.default_pic).into(imageView);

Use below line

Picasso.get().load(url).placeholder(R.drawable.default_pic).into(imageView);

Instead of with() :

Picasso.with().load(listdata.getImageurl()).into(img);

Use get() :

Picasso.get().load(listdata.getImageurl()).into(img);

And into the build.gradle add this :

 implementation 'com.squareup.picasso:picasso:2.4.0'

And this work for me...

you need change method with() for get()

example:

before:

Picasso.with(context).load(listaConductores.get(position).getAvatarUrl()).into(holder.imageId);

after:

Picasso.get().load(listaConductores.get(position).getAvatarUrl()).into(holder.imageId);

my dependencie:

implementation 'com.squareup.picasso:picasso:2.71828'

* Try this line of code, if you're using Picasso library v.2.5.2 *

Picasso.with(context).load("imageUrl").into(imageView);

Add this into your build.gradle file inside dependecies

implementation 'com.squareup.picasso:picasso:2.5.2'

* Try this line of code, if you're using older version for example v.2.4.0*

Picasso.get(context).load("imageUrl").into(imageView);

Add this into your build.gradle file inside dependecies

implementation 'com.squareup.picasso:picasso:2.4.0'

add in build.gradle file dependency compile 'com.squareup.picasso:picasso:2.5.2'

also instead Picasso.with().load("http://i.imgur.com/DvpvklR.png").into(imageView);

use

Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);//give application context.

for more info check this link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!