Android 改装在OkHttp 2.0中的类路径错误上检测到不受支持的OkHttp
我正在我的项目中使用Android 改装在OkHttp 2.0中的类路径错误上检测到不受支持的OkHttp,android,retrofit,okhttp,Android,Retrofit,Okhttp,我正在我的项目中使用revolution-1.6.0+okhttp-2.0.0-RC1。 当我运行这个项目时,我得到了一个错误 java.lang.RuntimeException: Retrofit detected an unsupported OkHttp on the classpath. To use OkHttp with this version of Retrofit, you'll need: 1. com.squareup.okhttp:okhttp:1.6.0 (or ne
revolution-1.6.0
+okhttp-2.0.0-RC1
。
当我运行这个项目时,我得到了一个错误
java.lang.RuntimeException: Retrofit detected an unsupported OkHttp on the classpath.
To use OkHttp with this version of Retrofit, 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!
有人知道如何解决这个问题吗?好的,square在github上发布了2.0 RC2,但在maven上没有: 但您仍然需要okhttp urlconnection(RC1),它仅在maven上: 别忘了okhttp 2.0现在依赖于okio:
即使使用OkHTTP 2,您也需要额外导入urlConnection
编译'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
我让毕加索/改装师像你一样抱怨。此配置对我有效:
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
请您告诉我,在改型的同时添加okhttp有什么好处,因为即使没有okhttp,改型也可以工作?实际上,如果您使用的是改型1.9.0,您不需要导入“okhttp urlconnection:2.0.0”。如果您使用的是OkHttp,则必须使用2.0或更高版本,并且不再需要使用OkHttp urlconnection shim@Ryan我可以确认我有一个使用改型1.9.0的EOFError,在导入改型1.9.0+okhttp2.3+okhttp-urlconnection2.3后不再出现。这个错误刚刚发生在我身上,在三星SIII上