我正在使用OneSignal android sdk版本3.10.6,它可以正常工作,但是最近我在连接到特定的wifi网络时遇到了异常。 Wifi网络正常运行,但是在后台,我继续在Logcat上收到此异常消息。
02-01 12:55:42.279 13730-16790/com.mypkg W/OneSignal: OneSignalRestClient: null Error thrown from network stack.
java.io.InterruptedIOException: thread interrupted
at com.android.okhttp.okio.Timeout.throwIfReached(Timeout.java:145)
at com.android.okhttp.okio.Okio$1.write(Okio.java:73)
at com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:155)
at com.android.okhttp.okio.RealBufferedSink.flush(RealBufferedSink.java:221)
at com.android.okhttp.internal.http.HttpConnection.flush(HttpConnection.java:141)
at com.android.okhttp.internal.http.HttpTransport.finishRequest(HttpTransport.java:52)
at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:903)
at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:789)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:443)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
at com.onesignal.OneSignalRestClient.startHTTPConnection(OneSignalRestClient.java:150)
at com.onesignal.OneSignalRestClient.access$100(OneSignalRestClient.java:38)
at com.onesignal.OneSignalRestClient$4.run(OneSignalRestClient.java:98)
at java.lang.Thread.run(Thread.java:818)
02-01 12:55:46.917 13730-16847/com.mypkg W/OneSignal: OneSignalRestClient: POST Error thrown from network stack.
java.io.InterruptedIOException: thread interrupted
at com.android.okhttp.okio.Timeout.throwIfReached(Timeout.java:145)
at com.android.okhttp.okio.Okio$1.write(Okio.java:73)
at com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:155)
at com.android.okhttp.okio.RealBufferedSink.flush(RealBufferedSink.java:221)
at com.android.okhttp.internal.http.HttpConnection.flush(HttpConnection.java:141)
at com.android.okhttp.internal.http.HttpTransport.finishRequest(HttpTransport.java:52)
at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:903)
at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:789)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:443)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
at com.onesignal.OneSignalRestClient.startHTTPConnection(OneSignalRestClient.java:150)
at com.onesignal.OneSignalRestClient.access$100(OneSignalRestClient.java:38)
at com.onesignal.OneSignalRestClient$4.run(OneSignalRestClient.java:98)
at java.lang.Thread.run(Thread.java:818)
02-01 12:55:46.919 13730-17024/com.mypkg W/OneSignal: HTTP code: -1 sending on_focus Failed
java.io.InterruptedIOException: thread interrupted
at com.android.okhttp.okio.Timeout.throwIfReached(Timeout.java:145)
at com.android.okhttp.okio.Okio$1.write(Okio.java:73)
at com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:155)
at com.android.okhttp.okio.RealBufferedSink.flush(RealBufferedSink.java:221)
at com.android.okhttp.internal.http.HttpConnection.flush(HttpConnection.java:141)
at com.android.okhttp.internal.http.HttpTransport.finishRequest(HttpTransport.java:52)
at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:903)
at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:789)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:443)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
at com.onesignal.OneSignalRestClient.startHTTPConnection(OneSignalRestClient.java:150)
at com.onesignal.OneSignalRestClient.access$100(OneSignalRestClient.java:38)
at com.onesignal.OneSignalRestClient$4.run(OneSignalRestClient.java:98)
at java.lang.Thread.run(Thread.java:818)
02-01 12:56:16.091 13730-17012/com.mypkg W/OneSignal: Location permission exists but GoogleApiClient timed out. Maybe related to mismatch google-play aar versions.
02-01 12:56:16.108 13730-17055/com.mypkg W/OneSignal: Failed last request. statusCode: -1
response: null
02-01 12:56:16.120 13730-17057/com.mypkg W/OneSignal: HTTP code: -1 sending on_focus Failed
如果我切换到其他wifi网络或移动网络,它将再次正常工作。