【问题标题】:Picasso detected an unsupported OkHttp on the classpathPicasso 在类路径上检测到不受支持的 OkHttp
【发布时间】:2014-07-30 07:44:33
【问题描述】:

我正在使用 Picasso 2.3.2 和 okhttp 1.5.4

最初我得到了这个 RTE:

java.lang.RuntimeException: Picasso detected an unsupported OkHttp on the classpath.
To use OkHttp with this version of Picasso, you'll need:
1. com.squareup.okhttp:okhttp:1.6.0 (or newer)
2. com.squareup.okhttp:okhttp-urlconnection:1.6.0 (or newer)
Note that OkHttp 2.0.0+ is supported!
        at com.squareup.picasso.Utils.createDefaultDownloader(Utils.java:246)
        at com.squareup.picasso.Picasso$Builder.build(Picasso.java:596)
        at com.squareup.picasso.Picasso.with(Picasso.java:473)

然后我用 com.squareup.okhttp:okhttp:1.6.0 更新了 pom(运行 mvn clean install,在 IntelliJ 中重新导入了 maven),但崩溃仍然发生。

有人知道如何解决这个问题吗?

【问题讨论】:

    标签: android picasso okhttp


    【解决方案1】:

    我面临同样的问题。 必须同时使用 okhttpokhttp-urlconnection。 我使用这三个库。然后它就可以正常工作了

    compile 'com.squareup.okhttp:okhttp:2.4.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
    compile 'com.squareup.picasso:picasso:2.4.0'
    

    试试看。祝你好运。

    【讨论】:

      【解决方案2】:

      答案在这里: https://github.com/square/picasso/issues/541

      必须同时使用 okhttp 和 okhttp-urlconnection,直到 OkHttp 2.0 final 出来。

      【讨论】:

      • 2.0 final 也需要。
      • 你有没有找到 okhttp-urlconnection 的 gradle 依赖项?
      • 对我来说,我正在使用 okhtttp3。我已经更新了毕加索。它工作正常
      【解决方案3】:

      我面临同样的问题。我通过使用解决此问题

       compile 'com.squareup.okhttp3:okhttp:3.0.0-RC1'
       testCompile 'com.squareup.okhttp3:mockwebserver:3.0.0-RC1'
       compile 'com.squareup.picasso:picasso:2.5.2'
      

      【讨论】:

        【解决方案4】:

        我更新了毕加索库的版本,它工作正常。 最新版本参考网站http://square.github.io/picasso/

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

        【讨论】:

          猜你喜欢
          • 2014-07-30
          • 2017-04-21
          • 2017-11-11
          • 2013-04-25
          • 2018-11-24
          • 1970-01-01
          • 2022-06-16
          • 2014-05-21
          • 2021-08-31
          相关资源
          最近更新 更多