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

Twitter logIn exception #24

Closed
dvasko opened this Issue Aug 17, 2015 · 6 comments

Comments

4 participants
@dvasko

dvasko commented Aug 17, 2015

Currently twitter-kit internally use:

retrofit = 'com.squareup.retrofit:retrofit:1.6.1'
okHttp = 'com.squareup.okhttp:okhttp:2.0.0'
okHttpUrlConnection = 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'

and with that setup everything work.

In my project i use:

compile('com.twitter.sdk.android:twitter:1.7.0@aar') {
    transitive = true;
}
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'

and with this setup i get exception on login:

com.twitter.sdk.android.core.TwitterApiException: method POST must have a request body.
        at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:400)
        at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
        at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
        at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at retrofit.Platform$Android$2$1.run(Platform.java:142)
        at java.lang.Thread.run(Thread.java:818)

some changes to POST have been made in okhttp 2.3.0 -> 2.4.0 that don't allow POST without request body.

@efrohnhoefer

This comment has been minimized.

Contributor

efrohnhoefer commented Aug 18, 2015

@dvasko Thanks for the note. This is a known issue with okhttp/retrofit. See: square/retrofit#854

@yqritc

This comment has been minimized.

yqritc commented Aug 27, 2015

@efrohnhoefer
The following issues have been closed.
square/okhttp#751
square/retrofit#854

JakeWharton suggests to add an empty body with @Body String body and pass an empty string as a workaround.
Are you going to add any workaround for this issue?

@efrohnhoefer

This comment has been minimized.

Contributor

efrohnhoefer commented Sep 2, 2015

I believe the issue has been resolved in okhttp 2.5. We will likely be upgrading in the near future.

@yqritc

This comment has been minimized.

yqritc commented Sep 3, 2015

@efrohnhoefer
I checked okhttp / okhttp-urlconnection 2.5.0 in my project, but still having the same exception.

@gabin8

This comment has been minimized.

gabin8 commented Dec 10, 2015

There's already version 1.11.0 released. Doesn't this issue fixed yet? Are there any workarounds?

@efrohnhoefer

This comment has been minimized.

Contributor

efrohnhoefer commented Feb 4, 2016

TwitterKit was updated to v1.12.1. See changelog for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment