Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
687 views
in Technique[技术] by (71.8m points)

image - cannot find symbol method with() using picasso library android

i'm getting one issue in android app, I am trying to check already existing app, the app contains

 implementation('com.squareup.picasso:picasso:3.0.0-SNAPSHOT') {
        exclude group: 'com.android.support'
    }

picasso library and

using that library in a class, here is the code

import com.squareup.picasso.Picasso;

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

here is the error, Error:(49, 20) error: cannot find symbol method with()

and my android studio version is 3.0 RC1, is this is an issue ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...