Okhttp3 is not see WebSocket interface in Android Studio

android, java, okhttp, square

Solution

You have to add the `okhttp-ws` module.

compile 'com.squareup.okhttp3:okhttp-ws:3.4.1'

WebSockets are moving out of a separate, experimental artifact and into the core `okhttp` artifact for the next release, 3.5.0, which is what you see if you look at GitHub.

Problem

I get some problems with okhttp3 lib. I added the following line in my gradle file dependency: ``` compile 'com.squareup.okhttp3:okhttp:3.4.1' ``` After that, I try to create webSocket connection like okhttp websocket example, but in Android Studio I don't see any classes and interfaces like ``` import okhttp3.WebSocket; import okhttp3.WebSocketListener; ``` But I know that these files exist in okhttp3. Can anybody explain what I did wrong? If we see in okhttp javadoc we can not find these classes. But they are in github.

Original source