android - 我怎样才能让 Picasso 和 OkHttp 一起工作?

标签 android picasso okhttp

我目前将以下库添加到类路径中(android 项目,minSDK 16):

  • picasso 2.3.3
  • okhttp 2.0.0
  • okhttp-urlconnection 2.0.0 RC1
  • okio 1.0.1

Picasso 现在以某种方式拒绝工作,我收到以下错误消息:

  VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
  VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
 Could not find method java.nio.file.Files.newOutputStream, referenced from method okio.Okio.sink
 VFY: unable to resolve static method 8759: Ljava/nio/file/Files;.newOutputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/OutputStream;
 VFY: replacing opcode 0x71 at 0x000a
 VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
 VFY: unable to find class referenced in signature ([Ljava/nio/file/OpenOption;)
 Could not find method java.nio.file.Files.newInputStream, referenced from method okio.Okio.source
 VFY: unable to resolve static method 8758: Ljava/nio/file/Files;.newInputStream (Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/InputStream;
 VFY: replacing opcode 0x71 at 0x000a

 Could not find method com.squareup.okhttp.OkHttpClient.setInternalCache, referenced from method com.squareup.okhttp.OkUrlFactory.setResponseCache
  VFY: unable to resolve virtual method 6548: Lcom/squareup/okhttp/OkHttpClient;.setInternalCache (Lcom/squareup/okhttp/internal/InternalCache;)Lcom/squareup/okhttp/OkHttpClient;
 VFY: replacing opcode 0x6e at 0x0009

 Could not find method com.squareup.okhttp.OkHttpClient.setConnectTimeout, referenced from method com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.setConnectTimeout
 VFY: unable to resolve virtual method 6541: Lcom/squareup/okhttp/OkHttpClient;.setConnectTimeout (JLjava/util/concurrent/TimeUnit;)Lcom/squareup/okhttp/OkHttpClient;
 VFY: replacing opcode 0x6e at 0x0005
 Could not find method com.squareup.okhttp.OkHttpClient.setReadTimeout, referenced from method com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.setReadTimeout
 VFY: unable to resolve virtual method 6553: Lcom/squareup/okhttp/OkHttpClient;.setReadTimeout (JLjava/util/concurrent/TimeUnit;)Lcom/squareu

有没有办法让这些库一起工作?

最佳答案

使用 okhttp-urlconnection 2.0.0,而不是 RC1。

关于android - 我怎样才能让 Picasso 和 OkHttp 一起工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25528917/

相关文章:

android - 支持库 AsyncTaskLoader 不支持被取消?

android - picasso 不从本地文件加载图像

java - 图像无法使用 picasso 加载到 ImageView 中?

java - 无法解析方法 setCookieHandler (java.net.CookieManger

android - 将 OkHttp 与现有的 HttpUrlConnection 代码一起使用?

java - Okhttp 在代理连接关闭后发送http请求

android - 在添加行之前检查 SQLite 数据库中的重复项

java - 使用警报管理器广播数据

android - 程序已成功安装但未在设备上显示

android - onStop 之后从未调用过的 fragment 的 onDestroyView