毕加索没有加载图片

Sag*_*ito 5 android image loading picasso okhttp

我一直在使用Picasso很长一段时间,但是我必须将OkHttp库升级到2.0.0,因此我必须将Picasso升级到版本2.3.2.

但是,现在Picasso根本不加载任何图像,图像视图留空.任何时候都没有出现任何错误,但是当我改变Picasso登录时,"Hunter"似乎已经被派遣并开始执行,但从未完成.

所有图像都可访问且相当小(约200px×100px).

我正在通过毕加索的"典型"方法加载图像:

Picasso.with(context).load(url).error(R.drawable.errorimg).into(imageView);
Run Code Online (Sandbox Code Playgroud)

但是,errorimg从未显示过.

我能做错什么?

编辑:

这是Picasso不工作的地方之一的代码(PlaceListAdapter.java - getView函数)

public View getView(int position, View convertView, ViewGroup parent) 
{
    final PBNPlace ev = values.get(position);

    LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View rowView = inflater.inflate(R.layout.places_list_item, parent, false);

    TextView titleView = (TextView)rowView.findViewById(R.id.place_title);
    ImageView placeImage = (ImageView)rowView.findViewById(R.id.place_image);

    Picasso picasso = Picasso.with(context);
    picasso.load(ev.imageURL).error(R.drawable.chat).into(placeImage);

    titleView.setText(ev.name);

    return rowView;
}
Run Code Online (Sandbox Code Playgroud)

Ben*_*n O 3

当您升级 OKHttp 时,您是否也升级了 okhttp-urlconnection 依赖项?

我遇到了这个问题,结果我仍在 build.gradle 文件中调用 okhttp-urlconnection 版本 1.6.0。没有任何错误消息让我很容易看出我忽略了这一点。

将其更改为 2.0.0 解决了问题。