【问题标题】:Images are not loading with picasso when used with okhttp与 okhttp 一起使用时,图片无法使用 picasso 加载
【发布时间】:2015-05-23 14:08:18
【问题描述】:

我正在使用下面的代码将图像加载到 android 中的 imageview 中

Picasso.with(context).load(finalImg)
                .transform(new RoundedTransformation(50, 4))
                .resize(100, 100).centerCrop()
                .into(viewHolder.profileImage);

观察:

  • 当我将 Picasso 与 http 一起使用时,此代码工作得非常好 图书馆
  • 但是我没有用okhttp-2.3.0.jar替换网络库
  • 我也用过okio-1.3.0.jar, okhttp-urlconnection-2.0.0.jar

发生了什么:

  • 我的图片没有加载

错误日志:

Could not find method com.squareup.okhttp.internal.Util.emptySink, referenced from method com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.initHttpEngine

如何解决?

【问题讨论】:

    标签: android picasso okhttp


    【解决方案1】:

    我找到了问题的解决方案:

    1. 我替换了上述规范 .... 用但替换了 okhttp-urlconnection-2.0.0.jarokhttp-urlconnection-2.2.0.jar
    2. 现在我可以正确加载图片了

    所以对我来说正确的组合是

    • okhttp-2.3.0.jar
    • okhttp-urlconnection-2.2.0.jar
    • okio-1.3.0.jar
    • 毕加索-2.4.0.jar

    【讨论】:

      猜你喜欢
      • 2014-09-23
      • 2015-11-25
      • 1970-01-01
      • 2019-08-14
      • 2015-05-12
      • 2019-08-20
      • 2018-05-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多