Closed passy closed 8 years ago
The actual error happened way upstream and was unfortunately swallowed by downstream exception handling and not correctly re-raised. The issue was that some other dependencies bumped okhttp
to >= 1.6 which doesn't include com.squareup.okhttp.OkUrlFactory
. This snippet here in com.parse.internal.signpost.basic.HttpURLConnectionClient
failed silently:
public static HttpURLConnectionClient create() {
try {
final Class okHttpClientClass = Class.forName("com.squareup.okhttp.OkHttpClient");
final Object okHttpClient = okHttpClientClass.getConstructor().newInstance();
final Class okUrlFactoryClass = Class.forName("com.squareup.okhttp.OkUrlFactory");
final Object okUrlFactory = okUrlFactoryClass.getConstructor(okHttpClientClass).newInstance(okHttpClient);
final Method okUrlFactoryOpen = okUrlFactoryClass.getMethod("open", URL.class);
return new HttpURLConnectionClient(true, okUrlFactory, okUrlFactoryOpen);
} catch (Exception e) {
return new HttpURLConnectionClient(true, null, null);
}
}
And when com.parse.internal.signpost.basic.HttpURLConnectionClient#open
is called, it raises an NPE. It'd be fantastic if this could at least write to the log informing you about the failed reflection call.
The actual fix was adding this for me:
compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.2'
I couldn't find any reference to this particular call in the repo so apologies if this is the wrong place to report it.
I'm trying to log in via Twitter, but both the Activity approach[0] or the manual approach[1] lead to the same error: A "Twitter login failed" toast and this in the debug log:
[0] Activity call:
[1] Manual:
[2] Application setup:
Is there any part of the setup I'm missing?