Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Version 0.3.2 is not working doing as the sample app #93

Closed
marcosvbras opened this issue Dec 18, 2018 · 2 comments
Closed

Version 0.3.2 is not working doing as the sample app #93

marcosvbras opened this issue Dec 18, 2018 · 2 comments

Comments

@marcosvbras
Copy link

The sample app is using RESTMockServer.getSSLSocketFactory() and RESTMockServer.getTrustManager() in Retrofit OkHttp and is not working with it, returning the following error:

12-18 18:59:12.629 2471-3623/? E/NetdConnector: RCV <- {600 Iface linkstate wlan0 up} 12-18 18:59:32.638 2471-3623/? E/NetdConnector: RCV <- {600 Iface linkstate wlan0 up} 12-18 18:59:38.517 18827-18896/br.com.ioasys.fdc E/AndroidRuntime: FATAL EXCEPTION: OkHttp Http2Connection Process: br.com.ioasys.fdc, PID: 18827 java.lang.NoSuchMethodError: No virtual method getRequestHeaders()Ljava/util/List; in class Lokhttp3/internal/http2/Http2Stream; or its super classes (declaration of 'okhttp3.internal.http2.Http2Stream' appears in /data/app/br.com.ioasys.fdc-2/base.apk:classes3.dex) at okhttp3.mockwebserver.MockWebServer$Http2SocketHandler.readRequest(MockWebServer.java:937) at okhttp3.mockwebserver.MockWebServer$Http2SocketHandler.onStream(MockWebServer.java:910) at okhttp3.internal.http2.Http2Connection$ReaderRunnable$1.execute(Http2Connection.java:674) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) 12-18 18:59:38.625 2471-3672/? E/ActivityManager: Will notifyMovedToHome from moveHomeStack 12-18 18:59:38.625 2471-3672/? E/ActivityManager: Broadcasting Moved to Home screen Intent 12-18 18:59:52.654 2471-3623/? E/NetdConnector: RCV <- {600 Iface linkstate wlan0 up} 12-18 19:00:12.375 2471-3627/? E/native: do suspend false

If I remove these methods related to SSL, it throws me an error related to SSL.

Retrofit version: 2.5.0
OkHttp version: 3.12.0

@andrzejchm
Copy link
Owner

andrzejchm commented Jan 20, 2019

this is most likely caused by discrepancies of okhttp3 and mockwebserver versions, can you try adding this to your app's build.gradle file to make sure all okhttp dependencies share the same version:

configurations.all {
    resolutionStrategy {
        force "com.squareup.okhttp3:okhttp:3.12.1"
        force "com.squareup.okhttp3:okhttp-tls:3.12.1"
        force "com.squareup.okhttp3:mockwebserver:3.12.1"
        force "com.squareup.okhttp3:logging-interceptor:3.12.1"
    }
}

@andrzejchm
Copy link
Owner

I've just released 0.3.3 version that should solve the issue by updating OkHttp to the latest version

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants