Android http connecting with OkHttp Dont work

后端 未结 2 511
眼角桃花
眼角桃花 2020-12-18 00:16

I am trying to use OkHttp but it keep crashing. Can someone have a quick look and see if you know whats happening. Thank you.

Log cat:

01-24 08:34:46         


        
相关标签:
2条回答
  • 2020-12-18 00:45

    OkHttp needs Okio, which OkHttp uses for fast I/O and resizable buffers. You can download Okio (latest JAR) here.

    or

    Android gradle : compile 'com.squareup.okio:okio:1.6.0'

    Maven

    <dependency>
        <groupId>com.squareup.okio</groupId>
        <artifactId>okio</artifactId>
        <version>1.6.0</version>
    </dependency>
    

    for version checks; github okio

    0 讨论(0)
  • 2020-12-18 00:50

    There seems to be a dependency on the 1.0 library of OkHTTP. It is a known report. You may follow it on the link below:

    https://github.com/square/okhttp/issues/870

    You should also include the library 1.0 in the project libs.

    0 讨论(0)
提交回复
热议问题