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

Crash with Facebook SDK #1191

Closed
guillaumelachaud opened this issue Dec 5, 2014 · 2 comments · Fixed by #1235
Closed

Crash with Facebook SDK #1191

guillaumelachaud opened this issue Dec 5, 2014 · 2 comments · Fixed by #1235
Labels
bug Bug in existing code
Milestone

Comments

@guillaumelachaud
Copy link

When I set URL.setURLStreamHandlerFactory(new OkUrlFactory(client)); accordingly to square/picasso#749, my app crashes because of the Facebook SDK :

  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.squareup.okhttp.internal.spdy.SpdyStream.close(com.squareup.okhttp.internal.spdy.ErrorCode)' on a null object reference
            at com.squareup.okhttp.internal.http.SpdyTransport.disconnect(SpdyTransport.java:221)
            at com.squareup.okhttp.internal.http.HttpEngine.disconnect(HttpEngine.java:465)
            at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.disconnect(HttpURLConnectionImpl.java:113)
            at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.disconnect(DelegatingHttpsURLConnection.java:93)
            at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.disconnect(HttpsURLConnectionImpl.java:25)
            at com.facebook.internal.Utility.disconnectQuietly(Utility.java:464)
            at com.facebook.Request.executeConnectionAndWait(Request.java:1563)
            at com.facebook.Request.executeBatchAndWait(Request.java:1460)
            at com.facebook.Request.executeBatchAndWait(Request.java:1429)
            at com.facebook.Request.executeBatchAndWait(Request.java:1411)
            at com.facebook.Request.executeAndWait(Request.java:1383)
            at com.facebook.Request.executeAndWait(Request.java:1269)
            at com.facebook.internal.Utility.getAppSettingsQueryResponse(Utility.java:708)
            at com.facebook.internal.Utility.access$000(Utility.java:57)
            at com.facebook.internal.Utility$1.doInBackground(Utility.java:630)
            at com.facebook.internal.Utility$1.doInBackground(Utility.java:627)
            at android.os.AsyncTask$2.call(AsyncTask.java:288)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)

Doesn't happen 100% of the time. Reproduced on Nexus 5 with Android 5.0 (LRX21O)

@swankjesse
Copy link
Collaborator

Looks like a bug in our code. We're disconnecting before sending the request headers. Can fix.

@swankjesse swankjesse added the bug Bug in existing code label Dec 6, 2014
@swankjesse swankjesse added this to the 2.2 milestone Dec 6, 2014
@guillaumelachaud
Copy link
Author

Liverail SDK seems to be affected by the same bug :

java.lang.NullPointerException: Attempt to invoke virtual method 'void com.squareup.okhttp.internal.spdy.SpdyStream.close(com.squareup.okhttp.internal.spdy.ErrorCode)' on a null object reference
            at com.squareup.okhttp.internal.http.SpdyTransport.disconnect(SpdyTransport.java:221)
            at com.squareup.okhttp.internal.http.HttpEngine.disconnect(HttpEngine.java:465)
            at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.disconnect(HttpURLConnectionImpl.java:113)
            at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.disconnect(DelegatingHttpsURLConnection.java:93)
            at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.disconnect(HttpsURLConnectionImpl.java:25)
            at libraries.marauder.analytics.request.protocol.c.a(Unknown Source)
            at libraries.marauder.analytics.request.protocol.a.a(Unknown Source)
            at libraries.marauder.analytics.j.a(Unknown Source)
            at libraries.marauder.analytics.j.b(Unknown Source)
            at libraries.marauder.analytics.j.a(Unknown Source)
            at libraries.marauder.analytics.r.run(Unknown Source)
            at libraries.marauder.analytics.n.run(Unknown Source)
            at libraries.marauder.analytics.utils.concurrent.g.run(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
            at libraries.marauder.analytics.utils.concurrent.c.run(Unknown Source)

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
Development

Successfully merging a pull request may close this issue.

2 participants