简体   繁体   English

使用 Picasso 库时无法解析方法 get()

[英]Cannot resolve method get() when using the Picasso library

When I try to use the Picasso library, I get an error saying "cannot resolve method get()".当我尝试使用 Picasso 库时,我收到一条错误消息,提示“无法解析方法 get()”。 What might be the cause of this?这可能是什么原因?

I've tried some solutions based on answers given on this type of question here on stack Overflow, but it didn't solve my problem.我已经根据堆栈溢出上此类问题给出的答案尝试了一些解决方案,但它没有解决我的问题。

Here is my dependency:这是我的依赖:

dependencies {
 implementation 'com.squareup.picasso:picasso:2.5.2'
}

Here is my Java code that throws the error "cannot resolve method get()":这是我的 Java 代码,它抛出错误“无法解析方法 get()”:

Picasso.get().load(retrieveProfileImage).into(targetImage);

I managed to solve the error by changing the Picasso library version from:我设法通过从以下位置更改 Picasso 库版本来解决错误:

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

to:到:

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

I know this is old but this answer may help of someone, I had the same issue to resolve it instead of using this using .get()我知道这是旧的,但这个答案可能对某人有帮助,我有同样的问题来解决它,而不是使用 .get()

Picasso.get().load(imageURL).into(imageView);

I used it using .with()我使用它使用 .with()

Picasso.with(context).load(imageURL).into(imageView);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM