【问题标题】:how can I get Picasso and OkHttp to work together?我怎样才能让 Picasso 和 OkHttp 一起工作?
【发布时间】:2014-10-21 03:24:45
【问题描述】:

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

  • 毕加索 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

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

【问题讨论】:

    标签: android picasso okhttp


    【解决方案1】:

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

    【讨论】:

    • 标记已被接受,因为它不再崩溃,但仍然收到unable to find class referenced in signature... 警告。有任何想法吗?哦,顺便说一句,OkHttp 比 android Volley 有什么优势吗?
    • 您可以忽略验证警告。
    猜你喜欢
    • 2017-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-25
    • 2020-02-03
    • 2012-04-22
    • 2013-03-28
    • 2013-04-26
    相关资源
    最近更新 更多