Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Android O CastException #3438

Closed
TheLester opened this issue Jun 29, 2017 · 9 comments · Fixed by #3624 or GulajavaMinistudio/okhttp#55
Closed

Android O CastException #3438

TheLester opened this issue Jun 29, 2017 · 9 comments · Fixed by #3624 or GulajavaMinistudio/okhttp#55
Labels
bug Bug in existing code
Milestone

Comments

@TheLester
Copy link

For Android O i noticed such crash in crashlytic,

Fatal Exception: java.lang.ClassCastException: android.system.UnixSocketAddress cannot be cast to java.net.InetSocketAddress
       at libcore.io.IoBridge.getLocalInetSocketAddress(IoBridge.java:700)
       at libcore.io.IoBridge.connectDetail(IoBridge.java:197)
       at libcore.io.IoBridge.connect(IoBridge.java:138)
       at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:129)
       at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:356)
       at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
       at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
       at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:356)
       at java.net.Socket.connect(Socket.java:616)
       at okhttp3.internal.platform.AndroidPlatform.connectSocket(AndroidPlatform.java:63)
       at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:223)
       at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:149)
       at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:192)
       at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121)
       at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100)
       at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
       at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
       at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
       at com.pubnub.api.interceptors.SignatureInterceptor.intercept(SignatureInterceptor.java:32)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
       at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
       at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
       at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
       at java.lang.Thread.run(Thread.java:764)

Will this be fixed in new version of library?

@JakeWharton
Copy link
Collaborator

JakeWharton commented Jun 29, 2017 via email

@TheLester
Copy link
Author

I have added an issue https://issuetracker.google.com/issues/63649622

@sjudd
Copy link

sjudd commented Sep 7, 2017

It looks like the fix for this missed O. Is there any workaround in OkHttp other than not calling cancel? It's ugly to skip cancelling queued requests made with OkHttp in O only.

@swankjesse swankjesse reopened this Sep 7, 2017
@swankjesse
Copy link
Collaborator

Yeah we'll work around and catch the exception.

@brunoreisportela
Copy link

Gosh! Getting same issue also.

@datayja
Copy link
Contributor

datayja commented Sep 23, 2017

@swankjesse any chances of the fix making it into production sometime soon? 💟

@leofirespotter
Copy link

@yschimke any chance of getting an intermediate release that fixes just this bug before 3.10 is released?

@yschimke
Copy link
Collaborator

cc @swankjesse @JakeWharton Seems like a clean fix to apply to a 3.9.1 branch.

@swankjesse
Copy link
Collaborator

Released as OkHttp 3.9.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in existing code
Projects
None yet
8 participants