-
-
Save adamsp/7ffd33906abf9b1a5df3 to your computer and use it in GitHub Desktop.
Logcat messages when trying to use latest OkHttp build (as at this commit: https://github.com/square/okhttp/commit/85fbb0abeb6d94ba963ea4302be02035a1563927). Built using 'mvn package -DskipTests' as I can't get the tests to pass.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
02-06 10:42:17.732: I/dalvikvm(1549): Could not find method com.squareup.okhttp.internal.http.HttpURLConnectionImpl.getContentLengthLong, referenced from method com.squareup.okhttp.internal.http.HttpsURLConnectionImpl.getContentLengthLong | |
02-06 10:42:17.732: W/dalvikvm(1549): VFY: unable to resolve virtual method 1361: Lcom/squareup/okhttp/internal/http/HttpURLConnectionImpl;.getContentLengthLong ()J | |
02-06 10:42:17.732: D/dalvikvm(1549): VFY: replacing opcode 0x6e at 0x0002 | |
02-06 10:42:17.732: I/dalvikvm(1549): Could not find method com.squareup.okhttp.internal.http.HttpURLConnectionImpl.getHeaderFieldLong, referenced from method com.squareup.okhttp.internal.http.HttpsURLConnectionImpl.getHeaderFieldLong | |
02-06 10:42:17.732: W/dalvikvm(1549): VFY: unable to resolve virtual method 1374: Lcom/squareup/okhttp/internal/http/HttpURLConnectionImpl;.getHeaderFieldLong (Ljava/lang/String;J)J | |
02-06 10:42:17.732: D/dalvikvm(1549): VFY: replacing opcode 0x6e at 0x0002 | |
02-06 10:42:18.552: D/dalvikvm(1549): GC_FOR_ALLOC freed 306K, 5% free 7986K/8328K, paused 21ms, total 21ms | |
02-06 10:42:18.852: W/dalvikvm(1549): threadid=16: thread exiting with uncaught exception (group=0x419eeba8) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): FATAL EXCEPTION: Twitter Stream consumer-1[Establishing connection] | |
02-06 10:42:18.852: E/AndroidRuntime(1549): Process: nz.net.speakman.android.dreamintweets, PID: 1549 | |
02-06 10:42:18.852: E/AndroidRuntime(1549): java.lang.NullPointerException | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at com.squareup.okhttp.internal.bytes.ByteString.of(ByteString.java:49) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at com.squareup.okhttp.internal.Platform$Android.getNpnSelectedProtocol(Platform.java:296) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at com.squareup.okhttp.Connection.upgradeToTls(Connection.java:153) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at com.squareup.okhttp.Connection.connect(Connection.java:94) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:245) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:190) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at com.squareup.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:372) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at com.squareup.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:97) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at com.squareup.okhttp.internal.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:210) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at com.squareup.okhttp.internal.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:213) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:135) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:61) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:98) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at twitter4j.TwitterStreamImpl.getUserStream(TwitterStreamImpl.java:228) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at twitter4j.TwitterStreamImpl$5.getStream(TwitterStreamImpl.java:200) | |
02-06 10:42:18.852: E/AndroidRuntime(1549): at twitter4j.TwitterStreamImpl$TwitterStreamConsumer.run(TwitterStreamImpl.java:462) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following was tested on a 2012 Nexus 7 running factory 4.4.2. Similar tests on a 4.3 Genymotion image resulted in
no issues and immediate closure of the stream (which was the original problem), even when setting OkHttp as the stream handlerthe same stack trace (forgot I was only setting OkHttp for 4.4+).The above stack trace began occurring in this commit - the stack trace shows the throw at line 295 of Platform.java in this commit. The
getNpnSelectedProtocol.invoke
call is returning null, causing theByteString.of
call to throw.If we look further up the Platform class, we can see that
getNpnSelectedProtocol
is being called onorg.conscrypt.OpenSSLSocketImpl
, or onorg.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl
:The docs for
getNpnSelectedProtocol
on line 1427 of the conscrypt OpenSSLSocketImpl source and on line 956 of the apache OpenSSLSocketImpl imply that "no protocol is agreed upon" - I'm not sure what this means, but it returns null in this case, and OkHttp isn't handling that.